>>> str = 'and now http://sub.domain.com/something/?here3=3ab&what=1#where=1 that was a URL'
>>> urls = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&#+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', str)
>>> urls
['http://sub.domain.com/something/?here3=3ab&what=1#where=1']
For me it looks like working but you never now... Comments from @HD42 would be highly appreciated =)
No comments:
Post a comment