a RegEx for phone numbers (issue #45)

This commit is contained in:
Matteo Manzinello
2020-07-16 14:32:05 +02:00
parent cac9fa594d
commit e00c8ea975
7 changed files with 8 additions and 11 deletions

View File

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