garysieling / jquery-highlighttextarea

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

Allow regex objects #39

Open mistic100 opened 9 years ago

mistic100 commented 9 years ago

The words parameter accept regex stored as strings ONLY (used with RegExp object) Should also directly accept RegExp object for nicer syntax and choice of flags

words:[
 'string regex', // used with gm or igm flags
  /litteral regex/gm,
  new RegExp('custom string regex', 'm')
]
JoshuaCWebDeveloper commented 8 years ago

In the meantime, it may be helpful to update the documentation at http://garysieling.github.io/jquery-highlighttextarea/ to better explain that currently, the words parameter can only accept strings.