From 68197eba811f308c1cf95745df47e9c16f3c15f1 Mon Sep 17 00:00:00 2001 From: Tommaso Poletti Date: Thu, 23 Jul 2020 19:13:38 +0200 Subject: [PATCH] Regex validateTel improvement --- src/mailgo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mailgo.ts b/src/mailgo.ts index 405a6bf..3bb8a72 100644 --- a/src/mailgo.ts +++ b/src/mailgo.ts @@ -924,7 +924,7 @@ const validateEmails = (arr: string[]): boolean => arr.every(validateEmail); // validate a single tel with regex const validateTel = (tel: string): boolean => - /^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$/.test(tel); + /^[+]{0,1}[\s0-9]{0,}[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$/.test(tel); // copy of a string const copyToClipboard = (str: string): boolean => {