diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index c66cf564..61518b60 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -106,3 +106,9 @@ export function formatNumberIntoCurrency(value) { export function startCase(str) { return str.charAt(0).toUpperCase() + str.slice(1) } + +export function validateEmail(email) { + let regExp = + /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ + return regExp.test(email) +}