Consider the following example:
$target = Xa,a,aX ;
$pattern = /X((a),?)*X/ ;
$matches = array();
preg_match_all($pattern,$target,$matches,PREG_OFFSET_CAPTURE|PREG_PATTERN_ORDER);
var_dump($matches);
What it does is returning only the last a in the series, but what I need is all the a s.
Particularly, I need the position of ALL EACH OF the a s inside the string separately, thus PREG_OFFSET_CAPTURE.
The example is much more complex, see the related question: pattern matching an array, not their elements per se
Thanks