Skip to content

Instantly share code, notes, and snippets.

@Tushkiz
Last active December 17, 2015 02:19
Show Gist options
  • Save Tushkiz/5535079 to your computer and use it in GitHub Desktop.
Save Tushkiz/5535079 to your computer and use it in GitHub Desktop.
Common Regular Expressions
// Common Regular Expression
// Email Address
/* Humans */ var emailHuman = /[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}/i;
/* Bots */ var emailBots = /^[\w!#$%&\’*+\/=?^`{|}~.-]+@(?:[a-z\d][a-z\d-]*(?:\.[a-z\d][a-z\d-]*)?)+\.(?:[a-z][a-z\d-]+)$/i;
// Date
var datePattern = /([01]?\d)[-\/ .]([0123]?\d)[-\/ .](\d{4})/;
// Web Address
var urlPattern = /^((https?:\/\/)|(www\.))\S*$/;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment