Skip to content

Instantly share code, notes, and snippets.

View jlittlejohn's full-sized avatar

Josh Littlejohn jlittlejohn

View GitHub Profile
@jlittlejohn
jlittlejohn / gist:5753906
Created June 11, 2013 01:23
RegEx: Credit Card Number
[0-9]{13,16}
@jlittlejohn
jlittlejohn / gist:5753904
Created June 11, 2013 01:23
RegEx: US Postal Code
(\d{5}([\-]\d{4})?)
@jlittlejohn
jlittlejohn / gist:5753902
Created June 11, 2013 01:22
RegEx: Date (MM/DD/YYYY)
(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d
@jlittlejohn
jlittlejohn / gist:5753897
Created June 11, 2013 01:22
RegEx: US Phone Number (123-456-7890)
\d{3}[\-]\d{3}[\-]\d{4}
@jlittlejohn
jlittlejohn / gist:5753892
Created June 11, 2013 01:21
RegEx: Pricing Format
\d+(\.\d{2})?
@jlittlejohn
jlittlejohn / gist:5753891
Created June 11, 2013 01:21
RegEx: Longitude or Latitude
-?\d{1,3}\.\d+
@jlittlejohn
jlittlejohn / gist:5753888
Created June 11, 2013 01:21
RegEx: Numbers with or without decimals
[-+]?[0-9]*[.,]?[0-9]+
@jlittlejohn
jlittlejohn / gist:5753884
Created June 11, 2013 01:20
RegEx: Valid Domain
^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$
@jlittlejohn
jlittlejohn / gist:5753881
Created June 11, 2013 01:20
RegEx: Username with 2-20 Characters
^[a-zA-Z][a-zA-Z0-9-_\.]{1,20}$
@jlittlejohn
jlittlejohn / gist:5753880
Created June 11, 2013 01:19
RegEx: Alpha Numeric
[a-zA-Z0-9]+