Skip to content

Commit

Permalink
email validator function fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ayush3160 committed Oct 2, 2022
1 parent fe82be1 commit b39cf90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ let {
sort,
ext,
title,
dateDelta
dateDelta,
emailValidator
} = require('./src/utils/utils');

// matrix
Expand Down Expand Up @@ -759,6 +760,7 @@ module.exports = {
ext,
title,
dateDelta,
emailValidator,
// matrix
matAdd,
matSub,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ let title = (lower) => {
* @example emailValidator('[email protected]') => true
*/
let emailValidator = (email) => {
let emailformat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
let emailformat = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;

if(email.match(emailformat)){
return true
Expand Down

0 comments on commit b39cf90

Please sign in to comment.