aboutsummaryrefslogtreecommitdiff
path: root/src/constants/regex.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/constants/regex.ts')
-rw-r--r--src/constants/regex.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/constants/regex.ts b/src/constants/regex.ts
index 7de36492..61523203 100644
--- a/src/constants/regex.ts
+++ b/src/constants/regex.ts
@@ -1,7 +1,8 @@
/**
* The email regex has complex constraints compliant with RFC 5322 standards. More details can be found [here](https://emailregex.com/).
*/
-export const emailRegex: RegExp = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
+export const emailRegex: RegExp =
+ /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
/**
* The password regex has the following constraints
@@ -11,7 +12,8 @@ export const emailRegex: RegExp = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@
* - at least one uppercase letter ([A-Z])
* - at least one special character ([^a-zA-z0-9])
*/
-export const passwordRegex: RegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,120}$/;
+export const passwordRegex: RegExp =
+ /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,120}$/;
/**
* The username regex has the following constraints
@@ -33,7 +35,8 @@ export const nameRegex: RegExp = /^[A-Za-z'\-,. ]{2,20}$/;
* - min. 2 chars, max. 50 chars on website name
* - match alphanumerics, and special characters used in URLs
*/
-export const websiteRegex: RegExp = /^$|^(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,50}\.[a-zA-Z0-9()]{2,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]{0,35})$/;
+export const websiteRegex: RegExp =
+ /^$|^(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,50}\.[a-zA-Z0-9()]{2,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]{0,35})$/;
/**
* The website regex has the following constraints