handling html links

Haris Lekatsas lekatsas at EE.Princeton.EDU
Thu Jan 24 13:26:39 EST 2002


> Haris wrote:
> > p = re.compile(r'((ftp|http)://[\w-]+(?:\.[\w-]+)*(?:/[\w-\?=\.&~]*)*)')
> > [...]
> > error: bad character range
>
> I was able to narrow it down to this:
>
>   p = re.compile(r'[\w-\?]')   # error: bad character range
>   p = re.compile(r'[\w\-\?]')  # Works fine
>
> Does that help?  :)
>
> ## Jason Orendorff    http://www.jorendorff.com/
>
Jason,

This seems to be working, I tried it on a few examples... thanks!

Haris





More information about the Python-list mailing list