RegEx validate 01-09

More
3 years 11 months ago - 3 years 11 months ago #94295 by Xtale
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: 3 years 11 months ago by Xtale. Reason: typo

Please Log in to join the conversation.

More
3 years 11 months ago #94317 by DenisChenu
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) )

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

More
3 years 11 months ago #94352 by Xtale
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?

Please Log in to join the conversation.

More
3 years 11 months ago #94353 by Xtale
ok,seems like its a bug with my ls version 1.92 - it works with 2.00

Please Log in to join the conversation.