- Posts: 7
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Can I use the /ig switch on regular expressions in Relevance equations
- rsmokeUM
- Topic Author
- Offline
- New Member
Less
More
7 years 2 weeks ago #149405
by rsmokeUM
Can I use the /ig switch on regular expressions in Relevance equations was created by rsmokeUM
I am trying to check for text input that has any of a specific set of words in upper or lower case. The Relevance equation I am using is:
regexMatch("/(show|privatize|worried)/ig", G3Q00051.NAOK)
I expect this to match any of these entries in a text box:
show
Show
ShoW
SHOW
privatize
Privatize
worried
Worried
I am unable to get the /g switch to be accepted as valid perl regex. any ideas?
regexMatch("/(show|privatize|worried)/ig", G3Q00051.NAOK)
I expect this to match any of these entries in a text box:
show
Show
ShoW
SHOW
privatize
Privatize
worried
Worried
I am unable to get the /g switch to be accepted as valid perl regex. any ideas?
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
7 years 2 weeks ago #149411
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Can I use the /ig switch on regular expressions in Relevance equations
Which version/build of LimeSurvey is used?
We had some bugs around RegExp before.
We had some bugs around RegExp before.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3691
7 years 2 weeks ago - 7 years 2 weeks ago #149430
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 Can I use the /ig switch on regular expressions in Relevance equations
Yep, that seems to be broken, please
file a bug report
.
In the meantime, try using the strtolower() function to convert the input value to lowercase before testing:
In the meantime, try using the strtolower() function to convert the input value to lowercase before testing:
Code:
{regexMatch("/^(show|privatize|worried)$/", strtolower(G3Q00051.NAOK))}
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 7 years 2 weeks ago by tpartner.
The following user(s) said Thank You: rsmokeUM
The topic has been locked.
- rsmokeUM
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
7 years 2 weeks ago - 7 years 2 weeks ago #149434
by rsmokeUM
Replied by rsmokeUM on topic Can I use the /ig switch on regular expressions in Relevance equations
The Limesurvey version I use is Version 2.63.1+170305
(I know better than to place a help message without including the operating details )
using strtolower is the solution. I look forward to the switch support so I can use the global (/g) switch too. I'll file a bug report.
regexMatch("/(show|atmosphere|diag|vibe)/i", strtolower(G2Q00082.NAOK))
Thanks!!
(I know better than to place a help message without including the operating details )
using strtolower is the solution. I look forward to the switch support so I can use the global (/g) switch too. I'll file a bug report.
regexMatch("/(show|atmosphere|diag|vibe)/i", strtolower(G2Q00082.NAOK))
Thanks!!
Last edit: 7 years 2 weeks ago by rsmokeUM.
The topic has been locked.
- DenisChenu
- Away
- LimeSurvey Community Team
Less
More
- Posts: 13910
- Thank you received: 2546
7 years 2 weeks ago #149441
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 Can I use the /ig switch on regular expressions in Relevance equations
Maybe it's fixed here :
github.com/LimeSurvey/LimeSurvey/commit/...32b9bfff58c6c253fdb1
For next release.
For next release.
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 following user(s) said Thank You: rsmokeUM
The topic has been locked.
- rsmokeUM
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
7 years 2 weeks ago #149448
by rsmokeUM
Replied by rsmokeUM on topic Can I use the /ig switch on regular expressions in Relevance equations
It looks like it is fixed there, thanks!
The topic has been locked.
- DenisChenu
- Away
- LimeSurvey Community Team
Less
More
- Posts: 13910
- Thank you received: 2546
7 years 2 weeks ago #149526
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 Can I use the /ig switch on regular expressions in Relevance equations
Thanks Carsten, not me
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.