garysieling / jquery-highlighttextarea

http://garysieling.github.io/jquery-highlighttextarea/
156 stars 75 forks source link

Is there anyway to tell it to highlight words without matching the word within a word? #37

Closed losmurfs closed 9 years ago

losmurfs commented 9 years ago

If I want to highlight tree but not the tree in trees, how would I do that? I tried \btree\b but that didn't highlight anything.

mistic100 commented 9 years ago

It work perfectly.

Didn't you forget to double escape the word boundary ?

For regex stored as string you must use words: ['\\btree\\b']