- Posts: 176
- Thank you received: 36
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Regular expression fail (2.06+)
- fvanderstarre
- Topic Author
- Offline
- Elite Member
Less
More
7 years 11 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
Attachments:
The topic has been locked.
- first
- Offline
- Elite Member
Less
More
- Posts: 256
- Thank you received: 37
7 years 11 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
The topic has been locked.
- fvanderstarre
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 176
- Thank you received: 36
7 years 11 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!
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
7 years 11 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: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.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: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.