Skip to content

Instantly share code, notes, and snippets.

@ChukwuEmekaAjah
Last active July 29, 2020 21:08
Show Gist options
  • Save ChukwuEmekaAjah/69f3ac826bc03bb96d3fc3164e39da4e to your computer and use it in GitHub Desktop.
Save ChukwuEmekaAjah/69f3ac826bc03bb96d3fc3164e39da4e to your computer and use it in GitHub Desktop.
A list of common regular expression patterns implemented in every day programming work.
let dayRegex = /^(([0-2]?[1-9])|([3][0-1]))$/; //01-31
let monthRegex = /^(([0]?[1-9])|([1][0-2]))$/; //01-12
let emailRegex = /^\S*?@\S*?\.[a-z]{2,3}^/;
let lessThanTen = /^[0]?[1-9]?$/ // 1-9, 01-09
let percentRegex = /^([1-9][0-9]?)$|(^100$)/ // 1-100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment