I have a regex that I want to match a certain pattern. However, I don't want it to match that pattern if it exists between HTML comment blocks
What I have currently is:
(?<!<!--)pattern(?!-->)
However that only works when the pattern is exactly between comment blocks but not in the case of something like:
<!-- foo pattern -->
But if I do:
(?<!<!--.*)pattern(?!-->)
then this case doesn't work:
<!-- some commented out stuff --> pattern
I think if I could express (everything except -->)*? within the negative look behind it would work but I'm unsure of the proper syntax or if that's allowed.