Created
October 4, 2012 15:35
-
-
Save bigeasy/3834454 to your computer and use it in GitHub Desktop.
JavaScript regular expression to match regular expression special characters.
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
const REGEX = new RegExp('(\\' + '/ . * + ? | ( ) [ ] { } \\'.split(' ').join('|\\') + ')', 'g'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment