python re.search invalid expression even though it works on PHP and various other regex matchers

Posted by nubela on Stack Overflow See other posts from Stack Overflow or by nubela
Published on 2010-05-26T17:42:02Z Indexed on 2010/05/26 17:51 UTC
Read the original article Hit count: 283

Filed under:

Hi,

date = re.search(r'<td>([\x\d\w-.\s,()&\"]+|)<br><font',page_data)

I am migrating a code from PHP to Python, and am using this piece of regex expression on re.match, which doesn't work, giving a python error of:

raise error, v # invalid expression

It works on PHP's preg_match, and also http://www.gskinner.com/RegExr , any idea why this is happening? Thanks!

© Stack Overflow or respective owner

Related posts about regex