I have a string of emails "[email protected]; [email protected]; [email protected]"
how to write simple regex to check if all words contains [@.] at least once in the word?
No need for regex:
bool allOk = str.Split(';').All(email => email.Count(c => c == '@') == 1);
Although this may lead to erronous results (foo@bar_foo.com
is not a valid email!)
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