Regular expression fail (2.06+)

More
3 years 8 months ago #134296 by fvanderstarre
I have a short free text question with input box width 4 and max chars 4 where I want people to enter "+" or "-" followed by a number (three digits max), or zero. The regular expression I built to validate works OK when I test it on regex101.com/ , but not in LimeSurvey it seems. There, any number entered after "+" except zero(es), is rejected.
Regex used: "/^0|((\+|-)[0-9]{1,3})$/". See attached survey lss file.
Any suggestions?
I already made a bug report .
Tnx, Frank
Attachments:

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
3 years 8 months ago #134321 by first
I am not absolutely sure but when limesurvey see two curly braces is a line . It considers it as Expression Manager.

Survey Designer and Programmer

Please Log in or Create an account to join the conversation.

More
3 years 8 months ago #134393 by fvanderstarre
I think it's the "+" character causing the trouble (survey logic check for the question is OK). "-" works fine!

Please Log in or Create an account to join the conversation.

More
3 years 8 months ago #134401 by Mazi

fvanderstarre wrote: I already made a bug report .

Please post the ticket ID or full link, thanks.

When using "{" or "}" within a regex, the Expression Manager should not do any replacement since the regex is treated as a string.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com
Want to use your survey offline -> www.offlinesurveys.com

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!