Check out the LimeSurvey source code on GitHub!

RegEx email validation in 1.91

More
2 years 10 months ago #105733 by AndrejL
Hi!

I can seem to validate an email address. I'm using short free text question on a Limesurvey 1.91+ version.

When I put

"/^(\w[-._+\w]*\w@\w[-._\w]*\w\.\w{2,3})$/"

in validation filed and click Save RegEx changes to

"/^(\\w[-._+\\w]*\\w@\\w[-._\\w]*\\w\\.\\w{2,3})$/" (double slashes inside).

And of course it doens't not work. What am I doing wrong?

Thank you,

Andrej

Please Log in to join the conversation.

More
2 years 10 months ago #105736 by Ben_V
Hi,

/(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})/

Cf. doc ;)

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)

Please Log in to join the conversation.

More
2 years 10 months ago #105739 by AndrejL

Ben_V wrote: Hi,

/(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})/

Cf. doc ;)


It's the same. If I insert your /(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})/ and save

it changes to /(\\w[-._\\w]*\\w@\\w[-._\\w]*\\w\\.\\w{2,3})/

Please Log in to join the conversation.

More
2 years 10 months ago #105776 by Ben_V
very weird...

Have a look at this previous post to get an example about how you can set your regex using embeded javascript.

On the other hand, maybe it's time to update your installation if you can, for the less to the 1.92 release.

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form