- Posts: 7
- Thank you received: 0
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
- Topic Author
- Offline
- New Member
Less
More
7 years 1 month ago #147775
by rsmokeUM
I am looking to use regular expressions with options in Relevance equations was created 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???
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13907
- Thank you received: 2546
7 years 1 month ago #147776
by DenisChenu
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.
Replied by DenisChenu on topic I am looking to use regular expressions with options in Relevance equations
Maybe : don't use Conditon designer : use Expression directly .
Then no added system
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
7 years 1 month ago #147783
by rsmokeUM
Replied by rsmokeUM on topic I am looking to use regular expressions with options in Relevance equations
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,
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
7 years 1 month ago #147796
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic I am looking to use regular expressions with options in Relevance equations
Enter a Relevance equation using Expression Manager -
manual.limesurvey.org/Expression_Manager
(search the forums for "regexMatch")
(search the forums for "regexMatch")
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13907
- Thank you received: 2546
7 years 1 month ago #147807
by DenisChenu
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.
Replied by DenisChenu on topic I am looking to use regular expressions with options in Relevance equations
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
7 years 1 month ago #148724
by rsmokeUM
Replied by rsmokeUM on topic I am looking to use regular expressions with options in Relevance equations
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??
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??
Attachments:
The topic has been locked.