Skip to content

Instantly share code, notes, and snippets.

View waqas385's full-sized avatar

Waqas Ahmed waqas385

View GitHub Profile
@waqas385
waqas385 / Valid Email Regular Express
Last active March 7, 2018 05:53
Simple regular expression to validate email using JS
/^\w+@[a-zA-Z]+\.(com|org|net)$/.test("foo@bar.com")
/*
* It will validate email of following pattern
* 1- Starting with any word
* 2- Must contains @
* 3- Must contains characters a-z & A-z after @
* 4- Must contains .
* 5- Ends with either (com, org or net)
*/