Welcome to the LimeSurvey Community Forum

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

RegEx /i (uppercase or lowercase) use in LimeSurvey

  • stevelegare
  • stevelegare's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
9 years 10 months ago #109015 by stevelegare
Hi all,
Can someones tell me how to use /i in a regex to accept uppercase OR lowercase in input?
Regex in Limesurvey are delimited by "/"

thanks
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 10 months ago #109125 by tpartner
Where are you using this regex? Can you give an example?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • stevelegare
  • stevelegare's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
9 years 10 months ago #109130 by stevelegare
Replied by stevelegare on topic RegEx /i (uppercase or lowercase) use in LimeSurvey
Hi,
I'm using the RegEx in a text input field (validation param) to validate a specific domain name.
I use this regex
Code:
/^(.+)(domain.ca)$/
. I would like to use the /i to accept upper or lower input.
Thanks
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 10 months ago #109142 by tpartner
Hmm...that does seem to be a bit of a bug.

You may have to to it the hard way:

Code:
regexMatch('/^(.+)([dD][oO][mM][aA][iI][nN].[cC][aA])$/', this)


.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • stevelegare
  • stevelegare's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
9 years 10 months ago #109290 by stevelegare
Replied by stevelegare on topic RegEx /i (uppercase or lowercase) use in LimeSurvey
Thanks for the example
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose