I have this string aaa11 bbb1 cccc aaaaa22 bbb2 aaaa444 bbb4 cccc
and I want to use a Regex that results into this:
aaa11 bbb1 cccc
aaaa444 bbb4 cccc
I tried this regex a+[0-9]+.+?(b+[0-9]+).+?(?!a+[0-9+]).+?c+
with preg_match_all
but it returns:
aaaa11 bbbb1 ccccc
aaaaa22 bbb2 aaaa444 bbb4 cccc
I tried using negative lookahead to prevent a+[0-9+]
in the middle but id does not work. How can I accomplish this?