Bug #51438 [Opn->Bgs]: First arg of preg_match()
| From: | johannes@php.net | Date: | Tue, 30 Mar 2010 12:14:02 +0000 |
| Subject: | Bug #51438 [Opn->Bgs]: First arg of preg_match() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-149190@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51438&edit=1
ID: 51438
Updated by: johannes@php.net
Reported by: abca_b_cabcom at hotmail dot com
Summary: First arg of preg_match()
-Status: Open
+Status: Bogus
Type: Bug
Package: Regexps related
Operating System: Windows 7
PHP Version: 5.3.2
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
echo "/^(([A-Z][a-z]*)+[\\])*([A-Z][a-z]*)+$/";
And see what you pass to the regexp engine. You're using " so \\]
becomes \] which escapes the ] ...
Previous Comments:
------------------------------------------------------------------------
[2010-03-30 14:01:53] abca_b_cabcom at hotmail dot com
Description:
------------
The regexs for preg_match() are suppose to work, but error occur
Test script:
---------------
//test1.php
echo preg_match("/^(([A-Z][a-z]*)+\\)*([A-Z][a-z]*)+$/", 'Plz\TestMe');
//test2.php
echo preg_match("/^(([A-Z][a-z]*)+[\\])*([A-Z][a-z]*)+$/",
'Plz\TestMe');
Expected result:
----------------
//test1.php - expected result
1
//test2.php - expected result
1
Actual result:
--------------
//test1.php - actual result
Warning: preg_match() [function.preg-match]: Compilation failed: missing
) at offset 34 in path\to\test.php on line 3
//test2.php - actual result
0
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51438&edit=1