#45446 [NEW]: some bugs in preg_match_all
| From: | killthem at empal dot com | Date: | Mon, 07 Jul 2008 13:02:21 +0000 |
| Subject: | #45446 [NEW]: some bugs in preg_match_all | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-126339@lists.php.net to get a copy of this message | ||
From: killthem at empal dot com
Operating system: FreeBSD4.10
PHP version: 5.2.6
PHP Bug Type: Regexps related
Bug description: some bugs in preg_match_all
Description:
------------
this code doesn't work in php5(5.2.6), but in php4(4.4.8)
Reproduce code:
---------------
<?
$string="<OPAPageResult><OPAretCode>00</OPAretCode><OPAretMessage>SUCCESS</OPAretMessage><OPAvalidfield>oid|price|mid|tid|uid|url|uip|paymethod|goodname|currency|buyername|buyertel|buyeremail|encrypted|sessionkey</OPAvalidfield><OPAjavascriptUrl>http://plugin.inicis.com/pay40_uni.js</OPAjavascriptUrl><OPAjavascript>ClN0YXJ0U21hcnRVcGRhdGUoKTsKZnVuY3Rpb24gZG9TdWJtaXQoKQp7CgkvL2RvY3VtZW50Lm9wYS5hY3Rpb249J09QQXBheS5qc3A111111111111111111111111111111</OPAjavascript></OPAPageResult>";
$match_ele_exp = '/<(\S+)([^>]*)>(.*?)<\/\\1>/s';
preg_match_all($match_ele_exp, $string, $match);
print_r( $match );
?>
--
Edit bug report at http://bugs.php.net/?id=45446&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45446&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45446&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45446&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45446&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=45446&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45446&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45446&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45446&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45446&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45446&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=45446&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=45446&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45446&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45446&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45446&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45446&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45446&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45446&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45446&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45446&r=mysqlcfg