Bug #13547: String position of preg_match_all
| From: | ejbe99 at hotmail dot com | Date: | Thu, 04 Oct 2001 19:41:42 +0000 |
| Subject: | Bug #13547: String position of preg_match_all | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-67286@lists.php.net to get a copy of this message | ||
From: ejbe99@hotmail.com
Operating system: Windows
PHP version: 4.0.6
PHP Bug Type: Feature/Change Request
Bug description: String position of preg_match_all
Hello.
I am not sure if a lot of other people would want this, but a humungous
amount of programmers I know need this.
There should be a feature in php, a function like
preg_mall_strpos or another parameter in preg_match_all.
What it should do is in each set of matches in preg_match_all, it should
also give the string position
of the match. This means $matches would look like this:
Array(0=>Array(0=>Array(0=> blah 1=> nother blah)
1=>Array(0=> 30 1=>52)));
The reason we wouldn't just use preg_replace,
is because a lot of us need to replace a mass
amount of matches according to the previous or future match. Without this
you would need a very complicated function --- Well not too complicated,
but if it is a
common problem you should make the parameter.
Thanks in advance!
EJ
--
Edit bug report at: http://bugs.php.net/?id=13547&edit=1