Common Regex Validation codes

If you want to add validation to any of your fields, you need to know a little bit about Regex Validators. Once you know what kind of validation you want to add, you can click the "Show Advanced Settings" menu under the field you want to add validation to and put in your Regex Validation code. 

This documentation page is simply a compiled table of different validation codes that our users have put in place to ensure that data entered matches what they want it to. If you have a validation code that you've used that you think would be good to add here, please email us at support@timetap.com and let us know so we can add it here:

Regex CodePurposeValid ValuesInvalid Values
^\(\d{3}\) \d{3}-\d{4}$
To format phone numbers as (###) ###-####(888) 123-4567

8881234567

888-123-4567

888 123-4567

(888)1234567

(888)123-4567

^\d{3}-\d{3}-\d{4}$To format phone numbers as ###-###-####888-123-4567

8881234567

888-123-4567

888 123-4567

(888) 1234567

(888) 123-4567

^[a-z.0-9_-]{3,30}@abc\.lmno\.edu$

To format email addresses and make sure that:

  • The handle (before the @ sign) only has letters and numbers
  • Make sure the ending is to a specific address which is @abc.lmno.edu

You can use this and replace the abc, lmno, and edu with the valid email address for you clients

alliebrown89@abc.lmno.edu

allie!brown89@abc.lmno.edu

alliebrown89@def.lmno.edu  

alliebrown89@abc.pqrs.edu  

alliebrown89@abc.lmno.com  

^(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$

To match all valid dates including leap years. Formats accepted mm/dd/yyyy or mm-dd-yyyy or mm.dd.yyyy format05/01/2023
05-01-2023
05.01.2023

05//01/2023
05-01--2023
05..01.23
^[a-zA-Z0-9]{12}To match a 12-alpha-numeric character field for an ID or similar. Rejects symbols and spaces. (You can change the integer between the curly brackets {} for any whole number of characters.)

1234asDfUi89

987jUh456ioP

1J2Ie4i0k2U4

1234

$Dfipasdfu12

87as78df56a0s

^.{25,}$

To ensure a Text Field or Text Area is populated with at least 25 characters of information to be submitted.

Technically the data in between the "{}" curly brackets can have a maximum and minimum set using the comma. In the example to the left, this is a 25 character minimum and no maximum. If you wanted to mandate at least 25 characters and up to 250 characters, it would read like this:

^.{25,250}$

test that this will be goingtest that won't be going