Searches $subject for all matches to the regular expression given in $pattern and puts them in $matches in the order specified by $flags.

After the first match is found, the subsequent searches are continued on from end of the last match.

declaration of preg_match_all

int preg_match_all ( string $pattern , string $subject , array &$matches [, int $flags ] [, int $offset ] )

test preg_match_all online

comments for preg_match_all

On 29. Feb 2012 09:45 Mejicano wrote:

Is there any tool that may help me easily create regex to use with preg_match_all, some kind of designer? I frequently need to use preg_match_all and I'm not that good, I'm not a programmer either. Or at least a link where I could learn advaced stuff in a easy way. Thank you

On 13. Feb 2012 19:22 butzi wrote:

@sheila: to find the date in a string, you can use this: @([a-zA-Z]{3}/[0-9]{1,2}/[0-9]{1,2})@ to find the parts of the date you can use this: @([a-zA-Z]{3})/([0-9]{1,2})/([0-9]{1,2})@

On 08. Feb 2012 21:52 sheila wrote:

I am not able to find a right pattern for a date like: Feb/8/2012. Can anyone tell me how should it be?

more comments for preg_match_all

There are some more comments for preg_match_all(). To see them all click here.


Leave your comment