ID: 26854 Updated by: [EMAIL PROTECTED] Reported By: chris_se at gmx dot net -Status: Open +Status: Bogus Bug Type: PCRE related Operating System: Linux PHP Version: 4.3.4 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Use a different delimiter instead. The library does not remove backslashes before delimiters and PCRE doesn't know what to do with (?\\!). Previous Comments: ------------------------------------------------------------------------ [2004-01-09 12:39:04] chris_se at gmx dot net Description: ------------ When I try to use ! as delimiter and use a negative lookahead assertion which is normally started with (?!, (?! of course does not work, because the ! will terminate the pattern (and PHP will of course complain). But when I try to escape the exclamation mark like (?\!, an error occurs. I assume the \ is not removed in front of the ! after the pattern is freed from its delimiters. Reproduce code: --------------- $res = preg_match ("!^(?\\!foo)[a-z]{3}$!", "bar"); Expected result: ---------------- $res contains true Actual result: -------------- Warning: Compilation failed: unrecognized character after (? at offset 3 in /home/christian/- on line 2 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26854&edit=1