Quote:
Originally Posted by hunter1611
Ok so, slightly confused. How do I plug a variable into that? Is regexNum the variable you're checking for numbers?
(Sorry, I'm really not a Javascript person..I fumble through it as needed).
|
The variables a and b in Wolfshade's example contain the strings to be analysed.
To answer your second question
var str = "This string contains 2 special characters ! and ?"
alert (/[^a-z0-9\s\_]/gi.test(str)); // i.e. anything other than letters, numbers, space, underscore