javascript - Negation of regular expression -
i have regular expression:
var regex = /^[-.:_a-za-z0-9]*/; but need test string see if has characters not match expression.
i have tried
var regex =/^[^-.:_a-za-z0-9]*$/; but did not catch characters looking for.
basically, need regular expression can use in javascript find character not - . : . a-z a-z or 0-9 in javascript string variable.
thisshouldpass
thisshou[][]ldfail
i suspect want remove anchors , *:
var regex =/[^-.:_a-za-z0-9]/;
Comments
Post a Comment