Merge pull request #47 from tomma5o/bugfix/45-validateTel-regex-improvement

Regex validateTel improvement
This commit is contained in:
Matteo Manzinello 2020-07-23 20:45:04 +02:00 committed by GitHub
commit 30dfd47068
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/mailgo.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

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

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