Is there a way to use the found occurrence within pattern? i.e.
$string='number23 cat99 dog23 car66';
for example, i want to find words that has number 23.... this doesnt work:
preg_match('/number(\d{2}) (.*?)%1/si', $string, $new);
Is there a way to use the found occurrence within pattern? i.e.
$string='number23 cat99 dog23 car66';
for example, i want to find words that has number 23.... this doesnt work:
preg_match('/number(\d{2}) (.*?)%1/si', $string, $new);
Not sure I well understand your need, but how about using preg_match_all:
preg_match_all('/([a-z]+23)\b/i', $string, $matches);
This will match number23
and dog23