Welcome to the LimeSurvey Community Forum

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

Double quotes in 'Validation' field

  • asfrag
  • asfrag's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago - 7 years 4 months ago #144544 by asfrag
Double quotes in 'Validation' field was created by asfrag
Hi.
I am trying to configure a validation for a short text field.

The current expression is:
/^[a-zA-Z'-'\.\s\-]{3,60}$/

I would like to add double quotes (") to the expression, in order to allow this symbol. However, any combination of the expression using double quotes deletes the double quotes and everything to the right.
e.g. typing:
/^[a-zA-Z'-'\"\.\s\-]{3,60}$/

after clicking 'Save' converts the expression in the 'Validation' field into:
/^[a-zA-Z'-'\

Am I doing something wrong? Is there a way to enable exception for double quotes in the 'Validation' field?

Thanks in advance for the reply.

Kind regards,
asfrag
Last edit: 7 years 4 months ago by asfrag. Reason: typos in topic
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #144581 by tpartner
Replied by tpartner on topic Double quotes in 'Validation' field
Instead of the validation field, try placing something like this in the Question validation equation :
Code:
regexMatch('/^[a-zA-Z\"\.\s\-]{3,60}$/', Q1)

You will note that I have removed the '-' part - I don't think that is valid.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose