From:
Operating system: Linux
PHP version: Irrelevant
Package: PCRE related
Bug Type: Bug
Bug description:character @ not handled properly with \b
Description:
------------
Hi,
I have a problem with the @ character at the end of a word, with the word
delimiter \b:
input: i wrote this exampl@ for you
preg_match('/\bexampl@/','i wrote this exampl@ for you') = 1
preg_match('/\bexampl@\b/','i wrote this exampl@ for you') = 0
the second preg_match should also return 1 !!
Test script:
---------------
<?php
$input='i wrote this exampl@ for you';
echo "input: ".$input."\n";
$patt='/\bexampl@/';
echo "preg_match('".$patt."','".$input."') = ".preg_match($patt,
$input)."\n";
$patt='/\bexampl@\b/';
echo "preg_match('".$patt."','".$input."') = ".preg_match($patt,
$input)."\n";
?>
Expected result:
----------------
for both preg_match, output should be 1, that is, the pattern should be
found in the input string
preg_match('/\bexampl@/','i wrote this exampl@ for you') = 1
preg_match('/\bexampl@\b/','i wrote this exampl@ for you') = 1
Actual result:
--------------
preg_match('/\bexampl@/','i wrote this exampl@ for you') = 1
preg_match('/\bexampl@\b/','i wrote this exampl@ for you') = 0
--
Edit bug report at http://bugs.php.net/bug.php?id=54702&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=54702&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=54702&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=54702&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=54702&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=54702&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=54702&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=54702&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=54702&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=54702&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=54702&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=54702&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=54702&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=54702&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=54702&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54702&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54702&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=54702&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=54702&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=54702&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=54702&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=54702&r=mysqlcfg