Created
June 30, 2015 22:11
-
-
Save joshterrill/d09010fc678951d9d5ec to your computer and use it in GitHub Desktop.
valid filename regex
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
var str = '// \\ / \ _ - . ( ) () &&& !@#$%^&*)*_+=this is a test #$^*#<><>[][]{}{}{}{)(*#@'; | |
var result = str.replace(/_|#|\\|\/|-|\.|\ |\(|\)|\&|\@|\!|\$|\%|\^|\*|\+|\=|\[|\]|\{|\}|\'|\"|\<|\>|\?|/g,''); | |
console.log(result); | |
// thisisatest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment