- Posts: 198
- Karma: 3
- Thank you received: 36
Regular expression fail (2.06+)
- fvanderstarre
-
Topic Author
- Offline
- Gold Lime
-
Less
More
3 years 8 months ago #134296
by fvanderstarre
Regular expression fail (2.06+) was created 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
Regex used: "/^0|((\+|-)[0-9]{1,3})$/". See attached survey lss file.
Any suggestions?
I already made a bug report .
Tnx, Frank
Please Log in or Create an account to join the conversation.
3 years 8 months ago #134321
by first
Survey Designer and Programmer
Replied by first on topic Regular expression fail (2.06+)
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.
- fvanderstarre
-
Topic Author
- Offline
- Gold Lime
-
Less
More
- Posts: 198
- Karma: 3
- Thank you received: 36
3 years 8 months ago #134393
by fvanderstarre
Replied by fvanderstarre on topic Regular expression fail (2.06+)
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.
3 years 8 months ago #134401
by Mazi
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
Replied by Mazi on topic Regular expression fail (2.06+)
Please post the ticket ID or full link, thanks.fvanderstarre wrote: I already made a bug report .
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.