Skip to content
Snippets Groups Projects
Commit e8866738 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

fix: regex issue on phone number and text without number

parent 4eb56fff
No related branches found
No related tags found
2 merge requests!85Recette,!84Dev
......@@ -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,})';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment