From 31193b7ab8c8179a21bab435a309c46926a61453 Mon Sep 17 00:00:00 2001 From: Antonin Coquet <ext.sopra.acoquet@grandlyon.com> Date: Mon, 10 May 2021 11:33:59 +0200 Subject: [PATCH] fix: update regex of password and email to handle hyphen --- src/app/utils/CustomRegExp.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/utils/CustomRegExp.ts b/src/app/utils/CustomRegExp.ts index af6b6f83d..10624a7a5 100644 --- a/src/app/utils/CustomRegExp.ts +++ b/src/app/utils/CustomRegExp.ts @@ -2,11 +2,11 @@ export class CustomRegExp { /** * Validate a password (at least 8 characters, 1 uppercase letter, 1 lowercase letter, 1 number, and 1 special character) */ - public static readonly PASSWORD: RegExp = /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})/; //NOSONAR + public static readonly PASSWORD: RegExp = /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[-!@#$%^&*])(?=.{8,})/; //NOSONAR /** * Validate an email */ - public static readonly EMAIL: RegExp = /^[a-z0-9.-_]+@[a-z0-9.-]+[.][a-z]{2,3}/; //NOSONAR + public static readonly EMAIL: RegExp = /^[a-z0-9.\-_]+@[a-z0-9.-]+[.][a-z]{2,3}/; //NOSONAR public static readonly TEXT_WITHOUT_NUMBER: RegExp = /^[A-Za-zÀ-ÖØ-öø-ÿ- ]{1,}$/; //NOSONAR /** * Validate a password (at least 8 characters, 1 uppercase letter, 1 lowercase letter, 1 number, and 1 special character) -- GitLab