seanliang / HighlightWords

A Sublime Text 2 & 3 plugin for highlighting mutiple words in different colors
https://github.com/seanliang/HighlightWords
58 stars 21 forks source link

Allow regular expressions on highlight #7

Closed carlosedp closed 10 years ago

carlosedp commented 10 years ago

It would be great if the plugin allows regular expressions in the search pattern.

seanliang commented 10 years ago

The panel which plugin creates can only contain an input field. To accomplish your suggestion, which approach do you think is better?

  1. Add a customizable option 'treat_as_regular_expressions': treat the search terms as regular expressions instead of literals if it is True
  2. Add a separated menu item named "Highlight Regular Expressions"
liuhewei commented 10 years ago

@seanliang I think yours plan 1 is better, just like the search panel of ST

carlosedp commented 10 years ago

Agreed. Another thing is to treat spaces as pattern separators as it's now. If you need a space in regex, one must use "\s" or "\ " depending on the regex library you used.

seanliang commented 10 years ago

@carlosedp @liuhewei This idea has been implemented, thanks for suggestion!