Ok, a quick post that I'm sure regular RegEx users use and/or
are aware of. I've used Expresso before to get
their already made expressions and to test others I have. But last night I
needed one for a specific phone number requirement on a field...not the one
Expresso had built-in. So I used their designer interface. Pretty
cool. So after about 5 mins I had this script to validate a phone number
that had to be formatted as xxx-xxx-xxxx. Not too complicated but I was
happy that I got it to work and now I know I can build more complicated ones in
their designer.
function ValidPhoneNumber(phoneNumber)
{
var filter=/\d{3}-\d{3}-\d{4}/;
if (filter.test(phoneNumber))
return true;
else
return false;
}