I have some strings like the following:
abc4back
abc4backpre
abc4front
abc4frontpre
abc3side
abc3sidepre
xyz4over
xyz4overpre
and I want to get those only with the "abc4" but without the "pre". So far, my regex is:
abc4.*(?!pre)
.
But, when I ran this, I got the error:
error parsing regexp: invalid or unsupported Perl syntax: `(?!`
.
I now know that this is because lookaheads are not supported in go.
But, I cannot figure out what expression I should use instead of ?!
. Does anyone know what will work?