Feature Request for pcre_match*()
| From: | 'Ricky' S Dhatt | Date: | Tue, 05 Mar 2002 04:09:24 +0000 |
| Subject: | Feature Request for pcre_match*() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-80716@lists.php.net to get a copy of this message | ||
Hi -
I'd like to ask that the pcre_match*() functions be modified such that
they can also return position info on where the match(s) occured, akin to
Perl's pos(). I think this would be a very useful addition, plus it
requires minimal code changes since the actual function, php_pcre_match()
computes the values presently but just throws them away.
I've modified my own build to do this, and I've attached a diff...but I'd
regard this as proof-of-concept code since I did it in a hurry (so maybe
it can make 4.2.0?) and I haven't coded in C since my university classes
couple years back. It's actually kinda of embarassing, but heck I don't
know any of you. =P.
The only really difficulty would be deciding how to return the
values...I've thought up a bunch of ways of implementing this
other than the stupidly simple add another nested array I did, like use a
resource, a new function, return a 2nd array, etc.
--Ricky