RegEx email validation in 1.91

More
3 years 3 weeks 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
3 years 3 weeks 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
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)

Please Log in to join the conversation.

More
3 years 3 weeks 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
3 years 3 weeks 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
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)

Please Log in to join the conversation.