Test for Alphanumeric
if (/\W/.test(s)) {
alert('That field is not alphanumeric.');
}
Test for Normal Full Name Structure
if ((!/^([a-z\x80-\xFF\'\.\-]+(. )?[ ]?)+$/i.test(sFull)) || (/\d/.test(sFull))) {
alert("The Full Name must be alphabetical and properly formatted (i.e., O'Malley Haven-Wilcox Jr.)";
}
Anyway, more can be found here, but they aren't all perfect and require testing:
http://regexlib.com/
No comments:
Post a Comment