Combine negative lookbehind and negative lookahead
How can I combine negative lookbehind (?<!) and negative lookahead (?!) with an AND?
With .Net/C#
I want to find the word big, but only if it is not inside (or [ or ` AND ) or ] or `
The problem is that I can't find big either when one of the brackets is there
Demo
https://regex101.com/r/V78jxd/2
Regex
(?<![\(\[`])big(?!.*[\)\]`])
Test Data
Should Match:
I like `xx` big `xx` cakes
I like big cakes
I like `big cakes
I like big` cakes
I like xx big xx cakes
I like ` xx big xx cakes
I like xx big xx` cakes
I like `xx` big `xx` cakes
I like big cakes
I like [big cakes
I like big] cakes
I like xx big xx cakes
I like [ xx big xx cakes
I like xx big xx] cakes
I like [xx] big [xx] cakes
I like big cakes
I like (big cakes
I like big) cakes
I like xx big xx cakes
I like ( xx big xx cakes
I like xx big xx) cakes
I like (xx) big (xx) cakes
I like (xx(test(big test big ( big ))) big xx) big (xx(test(big test big ( big ))) big xx) cakes
^^^
Should not Match:
I like (big) cakes
I like (xx big xx) cakes
I like [big] cakes
I like [xx big xx] cakes
I like `big` cakes
I like `xx big xx` cakes
I like (xx(test(big test big ( big ))) big xx) cakes