ID: 25700 Updated by: [EMAIL PROTECTED] Reported By: php at bouchery dot com Status: Bogus Bug Type: PCRE related Operating System: all PHP Version: Irrelevant New Comment:
The french translation have been fixed in CVS, no need to open a new bug. sorry for the time wasted... http://cvs.php.net/diff.php/phpdoc-fr/reference/pcre/functions/pcre.pattern.modifiers.xml?login=2&r1=1.2&r2=1.3&ty=u didou Previous Comments: ------------------------------------------------------------------------ [2003-09-30 10:05:25] php at bouchery dot com Sorry, it's a mistake in the french documentation ! "it is constrained to match between the start to the end of the string" Thus, it's a bug in the documentation's translation. ------------------------------------------------------------------------ [2003-09-30 08:44:01] [EMAIL PROTECTED] You misunderstood: echo preg_replace("/[a-z]{4}/A", "foo", "1fred24"); -> 1fred24 echo preg_replace("/[a-z]{4}/A", "foo", "fred24"); -> foo24 echo preg_replace("/[a-z]{4}/", "foo", "fred24"); -> foo24 echo preg_replace("/[a-z]{4}/", "foo", "1fred24"); -> 1foo24 See also this: http://www.php.net/manual/en/pcre.pattern.modifiers.php (the section about A (PCRE_ANCHORED)) ------------------------------------------------------------------------ [2003-09-30 07:02:17] php at bouchery dot com In fact, "A" option is equal to "^" + patern. If I don't misunderstand, "A" option should be equal to "^" + patern + "$" ------------------------------------------------------------------------ [2003-09-30 05:03:48] php at bouchery dot com Description: ------------ PCRE_ANCHORED option dosn't work Reproduce code: --------------- <?php echo preg_match( '`[a-z]{4}`A', 'fred24' ) ? 'ok' : 'ko'; ?> Expected result: ---------------- option "A" must return "ko" Actual result: -------------- Return "ok" and it's wrong ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25700&edit=1