Quantcast
Channel: Mendix Forum Questions
Viewing all articles
Browse latest Browse all 83218

Email validation to accept apostrophe

$
0
0

Hi all,

I want to create a regex as to allow emails with apostrophe in the user's name. For example, I would like Jack.O'Neill@email.com to be accepted as valid.

I now have the following regex:  '^[\w-\.+]+@([\w-]+\.)+[\w-]{2,4}$' and everytime I'd like to include the apostrophe as a special character it considers it as part of the regex and presents me with the following error: no viable alternative at input ']' . Please bare in mind I am not very good at creating regex, but as far as I read and documented myself by including \' it should escape this special character but it just considers it as part of the expression quote itself.

Hopefully, you guys will understand what I mean. 

Could you please help me with some information on this? It would be highly appreciated.

Many thanks and kind regards,

Razvan


Viewing all articles
Browse latest Browse all 83218

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>