Created
September 17, 2019 16:31
-
-
Save vendettamit/b7e28de40f1a174d1ff08e7a96c07fac 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
//Escape special characters in a string to use in batch file | |
var arg = "^hU$xgjX4ku*Hc0p%#F^UH"; | |
arg.replace(/([\(\)%!\^<>|;, ])/g,'^$1').replace(/&/g, '&&'); | |
console.log(arg); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment