Merge pull request #47 from tomma5o/bugfix/45-validateTel-regex-improvement
Regex validateTel improvement
This commit is contained in:
commit
30dfd47068
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1012,7 +1012,7 @@ var validateEmails = function validateEmails(arr) {
|
|||
|
||||
|
||||
var validateTel = function validateTel(tel) {
|
||||
return /^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$/.test(tel);
|
||||
return /^[+]{0,1}[\s0-9]{0,}[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$/.test(tel);
|
||||
}; // copy of a string
|
||||
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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 => {
|
||||
|
|
Loading…
Reference in New Issue