Created
December 3, 2018 15:56
-
-
Save olecksamdr/ccbbe87700d4c589d73bb66f95ed00e2 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
// Escapes a string for use in a regular expression. | |
str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment