Miguel Sanchez Miguel Sanchez - 9 months ago 62
Vb.net Question

Regex exclude brackets

I have the following regex:


Test string:

this is a test [est+where] esterius

it should only highlight the first "est". Sadly the bracket [ and the + symbol is also matched. But I want only my word "est" to be matched if the character before and after is non-alphabetical and not numeric


You should make use of lookaheads and lookbehinds:


Which basically match something without including it in the resulting match.