Created
June 24, 2018 06:30
-
-
Save arcturus011/b105d9181eca2f4793ae4c8438422e05 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function escapeRegExp(text) { | |
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment