Welcome to the LimeSurvey Community Forum

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

I am looking to use regular expressions with options in Relevance equations

  • rsmokeUM
  • rsmokeUM's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 3 months ago #147775 by rsmokeUM
Hello,
I am trying to use a regexMatch in a Relevance equation to trigger the presentation of checkboxes. I want to use the i (case insensitive) option on the expression but when I enter it into the Conditions designer the returned expression is bounded automatically by the delimiters '/'.

The regular expression I am trying to run is:
/(?:^|(?<= ))(show|privatize|worried)(?:(?= )|$)/i

When I enter that into the Conditions designer it gets appended (and returned) to be:
((regexMatch("//(?:^|(?<= ))(show|privatize|worried)(?:(?= )|$)/i/", G3Q00051.NAOK)))

I want it to be:
((regexMatch("/(?:^|(?<= ))(show|privatize|worried)(?:(?= )|$)/i", G3Q00051.NAOK)))

Any ideas???
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #147776 by DenisChenu
Maybe : don't use Conditon designer : use Expression directly .
Then no added system

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • rsmokeUM
  • rsmokeUM's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 3 months ago #147783 by rsmokeUM
Hmmm,
When I go to the question I have the options to [Set Conditions] which take me to the "Condition Designer" and that is where I run into my issue.
How can get to a spot that I can edit the regex directly?
Thanks,
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #147796 by tpartner
Enter a Relevance equation using Expression Manager - manual.limesurvey.org/Expression_Manager

(search the forums for "regexMatch")


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #147807 by DenisChenu
Before so what @tpartner show : remind to delete all existing condition done via GUI.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • rsmokeUM
  • rsmokeUM's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 months ago #148724 by rsmokeUM
Hello,
I have tried the suggestions and I am still getting an error claiming my regexMatch is not a valid perl regex. I have deleted the expression that was in the Conditions Designer and I am entering this in the question edit ->Relevance equation

Any more possible solutions to getting this regular expression to work??
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose