-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Currently most of the regex's use word boundaries as their bounding for highlighting, yet using variable names with dash casing will be captured in the regex's. Also in the screen shot above builtin bash strings will highlight even if they are the beginning of a word that is delimited by dashes.
I started by using this look behind:
(?<!-)
to ignore words that follow a dash but I quickly realized that this was gonna be very verbose and really stemmed from the nature of word boundaries in regex. Regex treats '-' as a boundary while bash does not. So to remedy this issue I was thinking that I could replace all the \b with a better definition of a bash centric word boundary. Something like (?<![\w-])(EXPR)(?![\w-])
What are your thoughts on this approach?
Thanks
