Trying to create a regex pattern for email address check. That will allow a dot (.) but not if there are more than one next to each other.
Should match:
test.test@test.com
Should not match:
test..test@test.com
Now I know there are thousands of examples on internet for e-mail matching, so please don’t post me links with complete solutions, I’m trying to learn here.
Actually the part that interests me the most is just the local part:
test.test that should match and test..test that should not match.
Thanks for helping out.
You may allow any number of
[^\.](any character except a dot) and[^\.])\.[^\.](a dot enclosed by two non-dots) by using a disjunction (the pipe symbol|) between them and putting the whole thing with*(any number of those) between^and$so that the entire string consists of those. Here’s the code:Yields: