Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Regular expression fail (2.06+)

  • fvanderstarre
  • fvanderstarre's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
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
The topic has been locked.
More
7 years 11 months ago #134321 by first
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
  • fvanderstarre's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
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
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
7 years 11 months ago #134401 by Mazi
Replied by Mazi on topic Regular expression fail (2.06+)

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: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose