diff --git a/src/app/utils/CustomRegExp.ts b/src/app/utils/CustomRegExp.ts index 94ead16e4b58b10bbf14e5c44fac913058f88927..e268d8229d75bde89e53c6a1158a8c40c3801541 100644 --- a/src/app/utils/CustomRegExp.ts +++ b/src/app/utils/CustomRegExp.ts @@ -7,8 +7,11 @@ export class CustomRegExp { * Validate an email */ public static readonly EMAIL: RegExp = /^[a-z0-9.-]+@[a-z0-9.-]+[.][a-z]{2,3}/; - public static readonly TEXT_WITHOUT_NUMBER: RegExp = /^[A-Za-zÀ-ÖØ-öø-ÿ- ]{1,}/; - public static readonly PHONE: RegExp = /^([0-9]{2} ){4}[0-9]{2}/; + public static readonly TEXT_WITHOUT_NUMBER: RegExp = /^[A-Za-zÀ-ÖØ-öø-ÿ- ]{1,}$/; + /** + * Validate a password (at least 8 characters, 1 uppercase letter, 1 lowercase letter, 1 number, and 1 special character) + */ + public static readonly PHONE: RegExp = /^(?:(?:\+|00)|0)\s*[1-9](?:[\s.-]*\d{2}){4}$/; public static readonly WEBSITE: RegExp = /^(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/; public static readonly LINKEDIN: string = '(linkedin.com/in/.{1,})'; public static readonly FACEBOOK: string = '(facebook.com/.{1,})';