RegEx validate 01-09

More
4 years 3 months ago - 4 years 3 months ago #94295 by Xtale
Xtale created the topic: RegEx validate 01-09
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: 4 years 3 months ago by Xtale. Reason: typo

Please Log in to join the conversation.

More
4 years 3 months ago #94317 by DenisChenu
DenisChenu replied the topic: RegEx validate 01-09
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).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
4 years 3 months ago #94352 by Xtale
Xtale replied the topic: RegEx validate 01-09
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
4 years 3 months ago #94353 by Xtale
Xtale replied the topic: RegEx validate 01-09
ok,seems like its a bug with my ls version 1.92 - it works with 2.00

Please Log in to join the conversation.

Did you already participate in our customer survey?

Don't miss your chance for great prices.

Please click here to participate:

Start now

Start now!

Just create your account and start using Limesurvey today.

Register now