Can anyone help out with RegEx for custom date validation. I want ensure it is a valid date AND after 01/01/2018. Qualtrics support recommended setting up as a form, but that seems a bit cumbersome. I'd like to have the XX/XX/XXXX format.
Page 1 / 1
Hi JulieT,
I know this is not an answer about Regex, but there are 3 date survey questions in the Qualtrics survey library under the demographics survey section. It may be possible to set the date range using the second and third date type. I need to learn more about regex and may play with this tonight with a Regex answer for you.
Rett
I know this is not an answer about Regex, but there are 3 date survey questions in the Qualtrics survey library under the demographics survey section. It may be possible to set the date range using the second and third date type. I need to learn more about regex and may play with this tonight with a Regex answer for you.
Rett
Thanks @rettweber I forget about Qualtrics libraries. I'm playing around with with two and three. Looks like I can set the date range. Thank you!
It is still worth some time for me to work out the regex, so I will give it a try tonight. I'll let you know what I figure out. Unfortunately reading regex can be a bit like reading hieroglyphics, so I will include an explanation for all of the setup.
Hi @JulieT ,
I know you found the date question, but I thought I would followup on the regular expression line.
I looked into the regex and there are a few sites that describe how to set regex for dates (ie https://regular-expressions.info/dates.html. There was also a nice discussion here (https://stackoverflow.com/questions/15491894/regex-to-validate-date-format-dd-mm-yyyy). You also have to rely upon regular expressions as they are interpreted in Javascript. There are slightly different flavors for different programming languages.
The advice across the different comment streams that I found (in programming forums, not specific to Qualtrics) was to use Javascript for validating the date rather than regular expressions. There are specific functions for dates in Javascript that you could use. Obviously, using the Qualtrics validation options is the first choice if possible, but then it looks like you really need to take a look at using Javascript.
Good Luck!!
Rett
I know you found the date question, but I thought I would followup on the regular expression line.
I looked into the regex and there are a few sites that describe how to set regex for dates (ie https://regular-expressions.info/dates.html. There was also a nice discussion here (https://stackoverflow.com/questions/15491894/regex-to-validate-date-format-dd-mm-yyyy). You also have to rely upon regular expressions as they are interpreted in Javascript. There are slightly different flavors for different programming languages.
The advice across the different comment streams that I found (in programming forums, not specific to Qualtrics) was to use Javascript for validating the date rather than regular expressions. There are specific functions for dates in Javascript that you could use. Obviously, using the Qualtrics validation options is the first choice if possible, but then it looks like you really need to take a look at using Javascript.
Good Luck!!
Rett
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.