Created
October 26, 2011 05:22
-
-
Save gtzilla/1315520 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
var raw_str_regex = "(?:\\s|^)((?:\!|\-)\\w+)"; | |
var regex = new RegExp(raw_str_regex, "gm"); | |
var lst = [ | |
"this is !not", | |
"this is !not", | |
"this is !not", | |
"this is !not", | |
"this is !not", | |
"this is !not" | |
]; | |
var check_okay = []; | |
for(var i=0; i<lst.length; i++) { | |
var test_value = regex.test( lst[i] ); | |
console.log(test_value, lst[i]); | |
if(test_value === true) { | |
check_okay.push(test_value); | |
} | |
} | |
if(check_okay.length === lst.length) { | |
console.log("okay"); | |
} else { | |
console.log("FAILED!!!!!!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment