a RegEx for phone numbers (issue #45)
This commit is contained in:
parent
cac9fa594d
commit
e00c8ea975
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
|
@ -992,8 +992,7 @@ var validateEmails = function validateEmails(arr) {
|
|||
|
||||
|
||||
var validateTel = function validateTel(tel) {
|
||||
// TODO: find a good regex for telephone numbers
|
||||
return true;
|
||||
return /^[+]*[(]{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
|
@ -891,10 +891,8 @@ const validateEmail = (email: string): boolean =>
|
|||
const validateEmails = (arr: string[]): boolean => arr.every(validateEmail);
|
||||
|
||||
// validate a single tel with regex
|
||||
const validateTel = (tel: string): boolean => {
|
||||
// TODO: find a good regex for telephone numbers
|
||||
return true;
|
||||
};
|
||||
const validateTel = (tel: string): boolean =>
|
||||
/^[+]*[(]{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