Is it possible to write a pattern such that it checks continuous occurrence of a character
should match
"[email protected]","[email protected]"
and it should not match
"[email protected]".
Basically i need this to check if the email address is valid
Any Suggestions?
If the language supports it, you can use negative look-ahead and look-behind:
(?<!\.)\.(?!\.)
This will only match a period not following or preceding a period. See it in action here.
You can invert you regex to match >1
dots - if it doesn't, string is valid:
\.{2,}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With