|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-09 12:57 UTC] andrei@php.net
[2004-01-09 13:07 UTC] chris_se at gmx dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 13:00:01 2025 UTC |
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