Search This Blog

Friday, January 14, 2011

A Bug related to 'Recursive Reference' in Regular Expression PHP 5.3

Environment:
  • Ubuntu 11.04
  • PHP 5.3
Domain name validation follows RFC 1034 - 3.5.

My project need a domain name validation function, so I coded one, using this Perl-style regular expression:

View at here.

But it can't work! I don't know why.

I've rewritten another one without the feature 'recursive reference':

View at here.

The two are exactly same, except the second replace all recursive references with characters.

The second one works!

So I think this is a bug of PHP PCRE and I've reported it at Bug 53728

No comments:

Post a Comment