preg_match_all() extra parameter
| From: | Manuzhai | Date: | Tue, 20 Aug 2002 06:28:59 +0000 |
| Subject: | preg_match_all() extra parameter | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-87130@lists.php.net to get a copy of this message | ||
Would it be possible to have an extra parameter for preg_match_all() that
would allow for a maximum number of matches to be set?
Ie, with $foo =
"<td>a</td><td>b</td><td>c</td><td>d</td><td>e</td>",
do
something like
preg_match_all("/<td>(.*?)<\/td>/", $foo, $r, PREG_PATTERN_ORDER, 4);
, which would return only matches a thru d, but not e. I think this might be
useful (especially to cut execution time).
Regards,
Manuzhai