ID: 48589 User updated by: mjs at beebo dot org Reported By: mjs at beebo dot org Status: Open Bug Type: PCRE related Operating System: OS X PHP Version: 5.2.9 New Comment:
Regexp documentation: http://php.net/manual/en/regexp.reference.php Previous Comments: ------------------------------------------------------------------------ [2009-06-17 20:23:44] mjs at beebo dot org Description: ------------ The regular expression /\Q$z\E/ matches (as far as I can tell) every string. It certainly matches some strings it shouldn't match: preg_match("/\Q$z\E/", "") -> MATCH (WRONG!) preg_match("/\Q$z\E/", "qqqq") -> MATCH (WRONG!) preg_match("/\Q $z\E/", "qqqq") -> NO MATCH (CORRECT) preg_match("/\Q $z\E/", " $z") -> MATCH (CORRECT) preg_match("/\Q\$z\E/", "\$z") -> MATCH (CORRECT) preg_match("/\Q\$z\E/", "$z") -> NO MATCH (CORRECT) The problem seems to occur if the regular expression begins with the string "\Q$" followed by at least one character. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48589&edit=1