I am trying to use regex in c# to handle a scenario where I want to find all instances of a word that are not wrapped in certain characters. A quick example is below when trying to highlight the word "high"
highlight
[+highlight
highlight+]
[+highlight some more+]
[+highlight+]
I was trying to use negative look ahead and behind but this doesn't appear to play all that nice. Something like this
(?<!\[[\+|-])\w*high\w*(?![\+|-]\])
The outcome I am after is the word "high" would be found in all but the last scenario.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.