Regex validateTel improvement

This commit is contained in:
Tommaso Poletti 2020-07-23 19:13:38 +02:00
parent ffb5ebb918
commit 68197eba81
1 changed files with 1 additions and 1 deletions

View File

@ -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 => {