- Posts: 33
- Thank you received: 2
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Email validation without spaces
- jorgesinval
- Topic Author
- Offline
- Junior Member
Less
More
3 years 10 months ago #201451
by jorgesinval
Sinval
Email validation without spaces was created 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.
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.
Sinval
The topic has been locked.
- tammo
- Offline
- Official LimeSurvey Partner
Less
More
- Posts: 966
- Thank you received: 219
3 years 10 months ago #201453
by tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Replied by tammo on topic Email validation without spaces
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
- tammo
- Offline
- Official LimeSurvey Partner
Less
More
- Posts: 966
- Thank you received: 219
3 years 10 months ago #201454
by tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Replied by tammo on topic Email validation without spaces
In other words: there is no 100% valid regex for this.
Tammo
Tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- jorgesinval
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 33
- Thank you received: 2
3 years 10 months ago #201463
by jorgesinval
Sinval
Replied by jorgesinval on topic Email validation without spaces
Which of them should I use in the validation field of LimeSurvey? Which do you suggest?
Sinval
The topic has been locked.
- tammo
- Offline
- Official LimeSurvey Partner
Less
More
- Posts: 966
- Thank you received: 219
3 years 10 months ago #201464
by tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Replied by tammo on topic Email validation without spaces
I have no recommendation, I never use this. If you need it, I would try.
Tammo
Tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13633
- Thank you received: 2490
3 years 10 months ago - 3 years 10 months ago #201478
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 Email validation without spaces
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).
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: 3 years 10 months ago by DenisChenu.
The topic has been locked.
- jorgesinval
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 33
- Thank you received: 2
3 years 10 months ago #201547
by jorgesinval
Sinval
Replied by jorgesinval on topic Email validation without spaces
Sorry, I did not get it. Which would you use? This one?
/^(\w[-._+\w]*\w@\w[-._\w]*\w\.\w{2,3,4})$/
/^(\w[-._+\w]*\w@\w[-._\w]*\w\.\w{2,3,4})$/
Sinval
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13633
- Thank you received: 2490
3 years 10 months ago - 3 years 10 months ago #201567
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 Email validation without spaces
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} …
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: 3 years 10 months ago by DenisChenu.
The topic has been locked.
- jorgesinval
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 33
- Thank you received: 2
3 years 8 months ago #203804
by jorgesinval
Sinval
Replied by jorgesinval on topic Email validation without spaces
Sinval
The topic has been locked.