Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

new method to check if a string is valid email id or not added #200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/emailchecker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default checker

/**
* This method checks whether the given string is valid email ID or not
* @param {String} val - imput email id
* @return {Boolean} - return true if the input string is valid email ID otherwise false
*/
function checker(val){
var reg=/^([A-Za-z0-9_\.\-]{1,})\@([A-Za-z0-9]{1,})\.([A-Za-z]{2,4})$/;
if (reg.test(val)==false){
return false
}
else{
return true
}
}