Check out the LimeSurvey source code on GitHub!

Problem - age validation with regular expression

More
6 years 3 months ago - 6 years 3 months ago #50180 by Grenadeh
I have a set of questions that should only be displayed to respondents age 18 - 24. I have used the regular expression /([1-2][8-4])/ as the condition and it does not work. What am I doing wrong?

If i use greater than or equal to 18, it works, but I need it to be <=24 & >=18 and it will not accept this logic, it will create an OR condition instead of an AND scenario.

I have also tried /(1[8-9]|2[0-4])/ to no avail. Admittedly I do not understand regular expressions much, I must not have paid attention to this in college.
Last Edit: 6 years 3 months ago by Grenadeh.

Please Log in to join the conversation.

More
6 years 3 months ago #50196 by Mazi
Which Limesurvey version do you use?

Did you test your regex by using a regex validator?

Do other simplier regex work when being used as conditions?


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form