|
@@ -26,6 +26,19 @@ export class ContactAddress {
|
|
|
return '+' + digits;
|
|
return '+' + digits;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public static isValidPhoneNumber(search: string) {
|
|
|
|
|
+ const remains = search.replace(/[0-9 +()-]/g, '');
|
|
|
|
|
+ if (remains !== '') {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const digits = search.replace(/[^0-9]/g, '');
|
|
|
|
|
+ if (digits.length > 16 || digits.length < 3) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public static parseEmail(search: string) {
|
|
public static parseEmail(search: string) {
|
|
|
const ats = search.replace(/[^@]/g, '');
|
|
const ats = search.replace(/[^@]/g, '');
|
|
|
if (ats.length === 1) {
|
|
if (ats.length === 1) {
|