Regex validateTel improvement
This commit is contained in:
parent
ffb5ebb918
commit
68197eba81
@ -924,7 +924,7 @@ const validateEmails = (arr: string[]): boolean => arr.every(validateEmail);
|
|||||||
|
|
||||||
// validate a single tel with regex
|
// validate a single tel with regex
|
||||||
const validateTel = (tel: string): boolean =>
|
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
|
// copy of a string
|
||||||
const copyToClipboard = (str: string): boolean => {
|
const copyToClipboard = (str: string): boolean => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user