-
-
Save Ultrabenosaurus/4474581 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// taken from http://stackoverflow.com/a/6969486/1734964 | |
// saved for my own laziness | |
function escapeRegExp(str) { | |
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment