Created
December 1, 2018 10:27
-
-
Save mreis1/27c6a1a05b4c0c549ae4fd2c4169d60d to your computer and use it in GitHub Desktop.
Usefull js regex
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
Replace content between two comments | |
var content = ` | |
//@CR_NAME | |
var BAR=''; | |
var FOO=''; | |
//@CR_END_NAME | |
`; | |
content.replace(/\/\/@CR_NAME(.|\n)*\/\/@CR_END_NAME/gi, 'NAME="'+ pkg.name + '";') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment