I have an string which looks like:
aaaaaaaa'bbbbbbbb?'cccccccccccc'ddddddddd'
I would like to get all the matches separate by '
but not the ones escaped with ?'
I managed to do it by using this expression:
(.*?)[^\\?]'
And I tested it on regexpal and seems to work properly.
When trying to apply it to my PHP code by using preg_match
I only get the first match.
This is my code:
preg_match ("/(.*?)[^\\?]'/i", $content, $matches);
print_r($matches);
And the result is:
Array
(
[0] => aaaaaaaaaaaaaaaa'
[1] => aaaaaaaaaaaaaaa
)
I'm expecting to get bbbbbbbb?'cccccccccccc'
and ddddddddd'
as well.
What am I doing wrong? Thanks.