Skip to content

Instantly share code, notes, and snippets.

@brandedoutcast
Last active November 19, 2016 15:33
Show Gist options
  • Save brandedoutcast/1006932c2967c1474b4beb31c10587f6 to your computer and use it in GitHub Desktop.
Save brandedoutcast/1006932c2967c1474b4beb31c10587f6 to your computer and use it in GitHub Desktop.
General collection of Regular Expressions for reusability
Timestamp 12 & 24 hr format
(?:[0-1]?\d|2[0-3]):[0-5]?\d(?:pm|am)?
Timestamp 12 hr format
(?:0?\d|1[0-2]):[0-5]?\d\s?(?:pm|am)
Date format supporting yesterday, today & tomorrow along with delimeters -, / & space
(?:today|tomorrow|yesterday|(?:[0-2]?\d|3[0-1])(\s|-|\/)(?:0?\d|1[0-2])\1\d{4})
Decimal number > 1
\d*[1-9]+\d*(?:\.\d{1,2})?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment