From 28adcf46be3fb55c19c4087fcf10ef0c4b26b293 Mon Sep 17 00:00:00 2001 From: LukaszSwierzewski <34383708+LukaszSwierzewski@users.noreply.github.com> Date: Thu, 21 May 2020 13:25:43 +0200 Subject: [PATCH] Create Validate email Check user email --- collections/string/Validate email | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 collections/string/Validate email diff --git a/collections/string/Validate email b/collections/string/Validate email new file mode 100644 index 00000000..4981103e --- /dev/null +++ b/collections/string/Validate email @@ -0,0 +1,7 @@ +const emailIsValid = (email) => { + return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email); +}; + +// emailIsValid('test@test.com') > true +// emailisValid('test@test') > false +// emailisValid('testtest.pl') > false