Every now and again I come across situations where I need to utilize the power of Regular Expressions to validate data entry. Here are some handy links and information to help you.
Here are some regular expressions that I have used in the past:
Computer Name: [0-9a-zA-Z_-]
Email Address: \w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
Web URL: http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?
Phone Number (US): ((\(\d{3}\) ?)(\d{3}-))?\d{3}-\d{4}
Social Security Number: \d{3}-\d{2}-\d{4}
Postal Code (zip +4): \d{5}(-\d{4})?
There is an extensive resource of very handy regular expressions:
http://regexlib.com/
Share This To :
0 comments:
Post a Comment