regexp-escape

Provides RegExp.escape function for quoting text for a regular expression.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
regexp-escape
300.0.110 years ago10 years agoMinified + gzip package size for regexp-escape in KB

Readme

regexp-escape
This simple module adds a RegExp.escape function that quotes a string so that it can be included in a regular expression as a literal match.
  • From: http://stackoverflow.com/a/5306111/106302
  • Originally from: http://simonwillison.net/2006/Jan/20/escape/ (dead link)