I'm trying to find and print all .com urls from a large text file using regex. As there are approx 40 different urls I'm wondering if there is a way to search for them without doing it one by one.
The code I used gets xxxx.com but is missing the https//:www at the beginning. Can anyone tell me how I get the full result? Thank you in advance!
import re 
url = len(".com") 
re = re.compile(r'\w*.com\b', url) 
for line in open("report.txt"): 
    for url in re.findall(line): 
        print url
 
     
    