Welcome, Guest
Username: Password: Remember me

TOPIC: Problem - age validation with regular expression

Problem - age validation with regular expression 4 years 2 weeks ago #50180

  • Grenadeh
  • Grenadeh's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 14
  • Karma: 0
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: 4 years 2 weeks ago by Grenadeh.
The administrator has disabled public write access.

Re:Problem - age validation with regular expression 4 years 2 weeks ago #50196

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
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)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.108 seconds
Donation Image