I'm trying to achieve the following thing: I want to negate the appearance of the substring '::' but only in a certain section of the string. For example:
a<anyStringWithout'::'>b<anyStringAlsoWith'::'>
I tried to do that with negative lookahead like this:
a(?!.*::).*b
But occurrences of '::' after 'b' also make the string to unmatch, for example: 'acb::'
Is there a way to achieve what I want with regex?
Thanks in advance!