I'm trying to match many occurances of regex.
My text is:
aaaHello WorldaaaSomethingaaaAnother thingaaaSame thing
And I want to match aaaHello WorldaaaSomethingaaa
, not aaaHello Worldaaa
and aaaAnother thingaaa
I tried to write a regex like that:
/aaa.*?aaa/g
It's enough to take all possibilities of pattern like aaaHello Worldaaa
, aaaHello WorldaaaSomethingaaa
, aaaHello WorldaaaSomethingaaaAnother thignaaa
... And so on... I can process them on the loop. I just want to take all occurances.
But I couldn't get what I want.