diff options
author | Ivan Chen <ivan@tagg.id> | 2021-05-24 17:23:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-24 17:23:04 -0400 |
commit | 53f624423fa8f758da5542e62704b59fa53316ea (patch) | |
tree | 9e3422d22e4ccbd71e0dfa4f608e155d57d28092 /src/constants/regex.ts | |
parent | 5afdf9208fd3d7498a2595797e6c9fb5f567fc61 (diff) | |
parent | b8958cda3485af46181e8a6091f12718acfb621c (diff) |
Merge pull request #444 from shravyaramesh/tma853-lint-errors
[TMA-853/851] Lint errors
Diffstat (limited to 'src/constants/regex.ts')
-rw-r--r-- | src/constants/regex.ts | 9 |
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 |