Welcome, Guest
Username: Password: Remember me

TOPIC: RegEx validate 01-09

RegEx validate 01-09 1 year 5 months ago #94295

  • Xtale
  • Xtale's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 17
  • Karma: 0
Hello,

I want to match numeric ranges from 01-09 and 10-31. While the code works for 10-31, I can't validate scores from 01-09 using the following code:

(!is_empty(Code_SQ007)),
regexMatch('/^(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/', Code_SQ007)


I do not understand the problem and would appreciate any suggestions
Best
x
Last Edit: 1 year 5 months ago by Xtale. Reason: typo
The administrator has disabled public write access.

RegEx validate 01-09 1 year 5 months ago #94317

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6272
  • Thank you received: 800
  • Karma: 240
Hello,

Maybe something like that:

(!is_empty(Code_SQ007) or regexMatch('/^(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/', Code_SQ007) )
The administrator has disabled public write access.

RegEx validate 01-09 1 year 5 months ago #94352

  • Xtale
  • Xtale's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 17
  • Karma: 0
Thank you! However, it does not work.

Even if I put it simple
regexMatch('/^(0[1-9])$/', Code_SQ007)

it seems that 0 as the first digit is generally ignored. Maybe bugged with limesurvey?
The administrator has disabled public write access.

RegEx validate 01-09 1 year 5 months ago #94353

  • Xtale
  • Xtale's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 17
  • Karma: 0
ok,seems like its a bug with my ls version 1.92 - it works with 2.00
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.213 seconds
Donation Image