Capturing a Repeated Group (explode | split)
Posted: Wed May 18, 2011 1:37 pm
hi folks!
I have a problem that is getting me crazy!
I have
and I want to have in $matches an array such as array('a','b','c','d'...) BUT preg_match keeps only the last match
I DO NOT WANT to use preg_match_all NOR explode, because this is just one small part of my regular expression
Is there a way to do it in php ? I have found the regular expression in http://www.regular-expressions.info/captureall.html
so it can work with other languages, but I don't know if you can do it with PHP!
Thanks!
I have a problem that is getting me crazy!
I have
Code: Select all
$string='abcdefghijklmnopqrstuvwxyz';
preg_match('|(([a-z])*)|',$string,$matches);
I DO NOT WANT to use preg_match_all NOR explode, because this is just one small part of my regular expression
Is there a way to do it in php ? I have found the regular expression in http://www.regular-expressions.info/captureall.html
so it can work with other languages, but I don't know if you can do it with PHP!
Thanks!