Regular Expression Library
These regular expressions are offered for use in form validation using the registerValidation method. There's no guarantee that they will work perfectly. Contact me if you find errors or have contributions. Also see http://www.regular-expressions.info/.
Any value other than blank
.+
Seven or more characters
.{7,}
Email address (loose)
^[a-zA-Z0-9_\.]{2,50}@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.?]+$
Email address (strict)
^[a-zA-Z0-9_\.]{2,50}@([a-zA-Z0-9\-\.?]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)$'
URL
^(((ht|f)tp(s?))\://)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\;\?\'\\\+&%\$#\=~_\-]+))*$
IP Address
^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$
HTML color
^#?[a-fA-F0-9]{3|6}$
MD5 Hash
^([a-z0-9]{32})$
Time
^[0-2]?[0-9]:[0-5][0-9]( ?(a\.?|p\.?)m\.?))?
US Postal Code
^[0-9]{5}(-?[0-9]{4})?$
US Dollars
^([0-9]+(\.[0-9]{2})?)?$