
October 2nd, 2008, 09:02 AM
|
|
Contributing User
|
|
Join Date: Feb 2007
Posts: 83
Time spent in forums: 1 Day 5 h 20 m 8 sec
Reputation Power: 7
|
|
|
Regex name test
hi
im trying to create a regex pattern for a name field. Basically, I want to throw an error only if the user types in certain strings
!?<>
otherwise, even if the field is empty, the field should be true.
this is the pattern i created,but it does not seem to work if I have a empty space in the field:
Code:
return /^[a-zA-Z']{1,40}$/.test(str);
|