Page 1 of 1

Compilation failed: lookbehind assertion is not fixed length

Posted: Mon Oct 22, 2007 12:14 pm
by kusal
Warning: preg_match_all() [function.preg-match-all]: Compilation failed: lookbehind assertion is not fixed length at offset 29


This is my code
'/(?<=Phone: \s? \<\/span\> \s*) [( \d].* \b/';

How can I over come this???

Posted: Mon Oct 22, 2007 12:48 pm
by GeertDD
PCRE doesn't support lookbehind constructions that can vary in length.

So either leave the \s? and \s* out, which is not an option I guess. Or just match the text in the lookbehind and then use capturing parentheses to pull out the part you really want.

Posted: Mon Oct 22, 2007 12:58 pm
by kusal
That is so bad, power of regex is simply went to waste :(
does .net support this??