handling html links

Jason Orendorff jason at jorendorff.com
Thu Jan 24 03:20:59 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/




More information about the Python-list mailing list