J
Jimbo
Hello
I am using regular expressions to grab URL's from a string(of HTML
code). I am getting on very well & I seem to be grabbing the full URL
but
I also get a '"' character at the end of it. Do you know how I can get
rid of the '"' char at the end of my URL
Example of problem:
My regular expression:
I am using regular expressions to grab URL's from a string(of HTML
code). I am getting on very well & I seem to be grabbing the full URL
but
I also get a '"' character at the end of it. Do you know how I can get
rid of the '"' char at the end of my URL
Example of problem:
I get this when I extract a url from a string
http://google.com"
I want to get this
http://google.com
My regular expression:
Code:
def find_urls(string):
""" Extract all URL's from a string & return as a list """
url_list = re.findall(r'(?:http://|www.).*?["]',string)
return url_list