I know there are thousands of questions regarding regex like using a regular expression to validate an email address and regular expression to match single dot but not two dots.
I created an regex as below, which is accepting '
(apostrophe) and .
(dot).
/^[\w-\.\']{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$/
But it will accept continuous double dots and continuous double apostrophe also. How do I prevent it?
E.g:
john's.presonal@somedomain.com
is correct.
john's..presonal@somedomain.com
is in-correct.
john's.presonal.email@somedomain.com
is correct.
I understand looking into before hyperlink that I need to use '/^([^\.]|([^\.])\.[^\.])*$/'
, but not sure how do I create my reg-ex!