Email validation without spaces

More
1 month 2 weeks ago #201451 by jorgesinval
Hello!

I am using this email validation expression: /^(\w[-._+\w]*\w@\w[-._\w]*\w\.\w{2,3})$/

Although, I had one of the participants inserting an email with spaces in the middle, which wasn't blocked by the validation expression. How can I update the above expression to avoid spaces in the middle of the email address?

Thank you.

Please Log in to join the conversation.

LimeSurvey Partners
More
1 month 2 weeks ago #201453 by tammo
Let me Google that for you. Found it:
emailregex.com/

Tammo


Tammo ter Hark at Respondage
For Limesurvey education and customized themes
respondage.nl

Please Log in to join the conversation.

More
1 month 2 weeks ago #201454 by tammo
In other words: there is no 100% valid regex for this.

Tammo


Tammo ter Hark at Respondage
For Limesurvey education and customized themes
respondage.nl
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

More
1 month 2 weeks ago #201463 by jorgesinval
Which of them should I use in the validation field of LimeSurvey? Which do you suggest?

Please Log in to join the conversation.

More
1 month 2 weeks ago #201464 by tammo
I have no recommendation, I never use this. If you need it, I would try.

Tammo


Tammo ter Hark at Respondage
For Limesurvey education and customized themes
respondage.nl

Please Log in to join the conversation.

More
1 month 2 weeks ago - 1 month 2 weeks ago #201478 by DenisChenu
w{2,3} : totally false (you have .social, .info etc …)

Else : to have a browser only way : gitlab.com/SondagesPro/QuestionTheme/EmailInput
(you can do same with js workaround).

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.
Last edit: 1 month 2 weeks ago by DenisChenu.

Please Log in to join the conversation.

More
1 month 2 weeks ago #201547 by jorgesinval
Sorry, I did not get it. Which would you use? This one?

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

Please Log in to join the conversation.

More
1 month 2 weeks ago - 1 month 2 weeks ago #201567 by DenisChenu
Why not
regexMatch('/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/',this.NAOK)

in manual.limesurvey.org/Question_type_-_Sh...8em_validation_sq.29

But start by remove the last part on {2,3,4} …

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.
Last edit: 1 month 2 weeks ago by DenisChenu.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now