Answer the question
In order to leave comments, you need to log in
PHP preg_match - how to pull an entry?
Good afternoon!
Help plz with regex - how to get only the first occurrence between 21 and 91? Now "xxxx91xxxx" is returned.
$string = '01xxxx21xxxx91xxxx91xxxx';
preg_match(('/^01(.*)21(.*)91.*$/'), $string, $re);
array(3) {
[0]=> string(29) "01xxxxx21xxxxxx91xxxxx91xxxxx"
[1]=> string(5) "xxxxx"
[2]=> string(13) "xxxxxx91xxxxx" }
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question