Omer wrote:
Bob, I tried your way.

>>> import re
>>> urlMask = r"http://[\w\Q./\?=\R]+(<br>)?"
>>> text=u"Not working example<br>http://this.is.a/url?header=null<br>And another line<br>http://and.another.url";
>>> re.findall(urlMask,text)
[u'<br>', u'']

Oops I failed to notice you were using findall. Kent explained it.

Another way to fix it is to make (<br>) a non-group: (?:<br>)

--
Bob Gailer
Chapel Hill NC 919-636-4239

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to