diff --git a/src/emailchecker.js b/src/emailchecker.js new file mode 100644 index 00000000..dbbea72c --- /dev/null +++ b/src/emailchecker.js @@ -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 + } + }