From 8e62aaa6dc7c61dcba7b9313d0aadcf7f46ce41b Mon Sep 17 00:00:00 2001 From: Husam Salhab <47015061+hsalhab@users.noreply.github.com> Date: Thu, 6 Aug 2020 16:11:11 -0400 Subject: [TMA-49] Add static boxes (#28) * adds BigInput component * removes dummy fields * adds website TaggInput * adds handleWebsiteUpdate() * added website regex * added form * added handleFocusChange() * sends website in request * moves input components to onboarding * allow for empty string in website regex * adds bio regex * adds bio field * added bioRef for focusChange * added react-native-datepicker * moves TaggInput * add imports * add TaggDatePicker * fix typescript interface * remove TouchableComponent type * added date and selectpicker * added date and dropdown * adds momentjs * remove warnings from optional fields * remove debugging console.log * Removes isValidBirthdate * moves @types/react-native-datepicker to devdepnden * update package versioning * fix positioning * added checkpoint * update button styling * update placeholder * linting and other fixes --- src/constants/regex.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/constants') diff --git a/src/constants/regex.ts b/src/constants/regex.ts index 40c82691..c380ee30 100644 --- a/src/constants/regex.ts +++ b/src/constants/regex.ts @@ -26,3 +26,25 @@ export const usernameRegex: RegExp = /^[a-zA-Z0-9_.]{6,30}$/; * - match alphanumerics, apostrophes, commas, periods, dashes, and spaces */ export const nameRegex: RegExp = /^[A-Za-z'\-,. ]{2,20}$/; + +/** + * The website regex has the following constraints + * - starts with http:// or https:// + * - 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})$/; + +/** + * The website regex has the following constraints + * - max. 150 chars for bio + * - match alphanumerics, and special characters used in URLs + */ +export const bioRegex: RegExp = /^$|^[A-Za-z'\-,. ]{1,150}$/; + +/** + * The gender regex has the following constraints + * - max. 20 chars for bio + * - match alphanumerics, hyphens, and whitespaces + */ +export const genderRegex: RegExp = /^$|^[A-Za-z\- ]{2,20}$/; -- cgit v1.2.3-70-g09d2