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.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/constants/regex.ts b/src/constants/regex.ts
index 350cb855..40c82691 100644
--- a/src/constants/regex.ts
+++ b/src/constants/regex.ts
@@ -19,3 +19,10 @@ export const passwordRegex: RegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA
* - match only alphanumerics, underscores, and periods
*/
export const usernameRegex: RegExp = /^[a-zA-Z0-9_.]{6,30}$/;
+
+/**
+ * The name regex has the following constraints
+ * - min. 2 chars, max. 20 chars ({2,20})
+ * - match alphanumerics, apostrophes, commas, periods, dashes, and spaces
+ */
+export const nameRegex: RegExp = /^[A-Za-z'\-,. ]{2,20}$/;