aboutsummaryrefslogtreecommitdiff
path: root/src/constants/regex.ts
diff options
context:
space:
mode:
authormeganhong <34787696+meganhong@users.noreply.github.com>2020-07-21 09:51:47 -0700
committerGitHub <noreply@github.com>2020-07-21 12:51:47 -0400
commitf1300739189283929cb20a22e5281388d1bbeafc (patch)
treeeaacd9999063c3ad45e3dc2e62f741e74aaf533e /src/constants/regex.ts
parente87d4f2b10cff8cf5f31784cfddb22727a94f373 (diff)
Tma119: Split Registration Screen (#23)
* split registration screen * styling * changed 4:2 to 3:3 * fade wizard with keyboard visibility * added regex for first and last name * accidentally saved videos in this folder * shortened fade duration to 300ms * add fade to Registration2 * rename RegistrationOne and RegistrationTwo * moved keyboard logic into RegistrationWizard * moved loading indicator out of the way * moving loading to outside of keyboard avoiding view * moved loading indicator up Co-authored-by: Megan Hong <meganhong31@g.ucla.edu>
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}$/;