Doc #60177 [NEW]: text is inconsistent
| From: | jasen at treshna dot com | Date: | Mon, 31 Oct 2011 02:48:31 +0000 |
| Subject: | Doc #60177 [NEW]: text is inconsistent | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-7365@lists.php.net to get a copy of this message | ||
From:
Operating system: any
PHP version: 5.3.8
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:text is inconsistent
Description:
------------
---
From manual page: http://www.php.net/reference.pcre.pattern.posix
---
the text says pcre stops at the first match.
>
> 3. Using the pattern one(self)?(selfsufficient)? on the string
> oneselfsufficient with PCRE will result in matching oneself, but using
POSIX
> the result will be the full string oneselfsufficient. Both (sub)strings
match
> the original string, but POSIX requires that the longest be the result.
>
The first match is 'one' not 'oneself'. preg_match behaves as described
(finding 'oneself') but the text does not explain why or how to predict
this behaviour. perhaps the definition of 'first' is unclear?
Test script:
---------------
preg_match('/one(self)?(selfsufficient)?/','oneselfsufficient',$r);
print_r($r); /* behaves as described */
preg_match('/one(self)?(selfsufficient)?/','one',$r);
print_r($r); /* one is the first match */
--
Edit bug report at https://bugs.php.net/bug.php?id=60177&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60177&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60177&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60177&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=60177&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60177&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=60177&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=60177&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=60177&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=60177&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=60177&r=support
Expected behavior: https://bugs.php.net/fix.php?id=60177&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=60177&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=60177&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=60177&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60177&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=60177&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=60177&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=60177&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=60177&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=60177&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=60177&r=mysqlcfg