Skip to main content
Answered

Regular Expression text field validation

  • Jun 22, 2021 8:55 AM UTC
  • 13 replies
  • 2190 views

Hi,

Is it possible to have regex validation of text fields in a survey?
We have some formats that input needs to adhere towards.

 

Best,

Simon - Kollektiv

Best answer by Grace

Hi everyone, the Product team has just released a new Answer validation feature which I am hoping will solve many of your regex validation issues. 

The feature is currently available for Long text, Short text and Email questions, with URL validation coming soon. 

All the information on how to set up a validation rule is available here in this Help Center article. I appreciate that this is a very old thread, but I hope this update is useful 🙏

View original

13 replies

Liz
Ex–Typefomer
Forum|alt.badge.img+5
  • Tech Community Advocate
  • Jun 22, 2021 4:10 PM UTC

Hi @Kollektiv thanks for stopping by the community! Out of box, we don’t have this feature, but this may be possible to setup with logic jumps. Would you mind sharing a bit more about what you’re looking to validate? 


  • Author
  • Explorer
  • Dec 22, 2021 9:54 AM UTC

Hi Liz,

I’m circling back on this question by my colleague, Simon. We’re currently using regular text fields to capture time inputs on a key Typeform that is used to capture user data when onboarding to a personalised athletic training service. The Typeform is built into a web container within our mobile apps. The time inputs that we are capturing need to adhere to the HH:MM:SS format. We’re trying everything to communicate explicitly to the user the importance of correct input, however we consistently see input errors on the output data.

It is the time input data that we are looking to validate. Even better if there is a time input field HH:MM:SS that we’re unaware of :)

Thanks,
Ben @ Kollektiv 


Liz
Ex–Typefomer
Forum|alt.badge.img+5
  • Tech Community Advocate
  • Dec 22, 2021 11:16 AM UTC

Hi @Kollektiv Thank you!! That helps! We don’t have an option to validate the time this way within the same field. You could use a separate field for hour/minute/second and have logic jumps set to prevent the respondent from submitting if it’s not the proper format. 


  • Explorer
  • Feb 3, 2022 3:20 PM UTC

Theree is a way to use regex to validate an input?


Liz
Ex–Typefomer
Forum|alt.badge.img+5
  • Tech Community Advocate
  • Feb 4, 2022 6:24 PM UTC

Hi @Wilson Neto I’m afraid we don’t have this feature available but do you mind sharing more about your use case? We can try to think of some workarounds!


  • Navigating the Land
  • Jan 19, 2023 2:24 PM UTC

Is this feature on the roadmap?  Its a bit of a blocker for us choosing to use Typeform, we are currently evaluating form software providers and this is one of our core requirements


Liz
Ex–Typefomer
Forum|alt.badge.img+5
  • Tech Community Advocate
  • Jan 19, 2023 3:22 PM UTC

Hi @Nick Smith This feature isn’t on the roadmap, but do you mind sharing your use case for it? That would be helpful for our product team to know when evaluating which features to build. 😀


  • Navigating the Land
  • Jan 19, 2023 3:25 PM UTC

Ah that is unfortunate as it probably means we can’t use typeform.  I want to apply regex validation to a field so that I can ensure the data entered matches the expected pattern.  e.g. we need to capture our customers UK bank account and sort code, or their company registration number.  These will have certain field validation requirements


Liz
Ex–Typefomer
Forum|alt.badge.img+5
  • Tech Community Advocate
  • Feb 16, 2023 5:04 PM UTC

Ah, got it, @Nick Smith . Thanks for sharing that - that helps us understand the use case behind it. I’ll share with product!


Forum|alt.badge.img
  • Explorer
  • Feb 27, 2023 4:44 PM UTC

+1 for this. Need to validate a “hidden field”


Forum|alt.badge.img+5
  • Community Wizard
  • Feb 28, 2023 9:21 AM UTC

Also interested in having custom regex and custom placeholder. Maybe you coud have a specific field that would be more permissive.

Use cases: UK postal code / US SSN or EIN / plate numbers / specific date formats such as MM/YYYY, or including time

  

+1 for this. Need to validate a “hidden field”

A hidden field can be validated in Javascript before passing it to Typeform


  • Navigating the Land
  • Mar 28, 2023 1:49 AM UTC

This is a completely obvious feature to include.

 

This forces me to allow my form to accept “*@!#&*)!@(#*!@)#(*!)@#” as an input to a simple name field...


Grace
Community Team
Forum|alt.badge.img+5
  • Community Advocate
  • Answer
  • Apr 7, 2026 11:37 AM UTC

Hi everyone, the Product team has just released a new Answer validation feature which I am hoping will solve many of your regex validation issues. 

The feature is currently available for Long text, Short text and Email questions, with URL validation coming soon. 

All the information on how to set up a validation rule is available here in this Help Center article. I appreciate that this is a very old thread, but I hope this update is useful 🙏