I'm validating mail addresses that could look something like this:
foo@bar.xx.com
but also
foo@bar.yy.com
I would like to check whether if xx
is present or not. The first thing that came to mind was String.Contains
, but it would obviously match any occurrences of xx
in the string.
Is regexp the way to go? If so, please help me with the pattern.
Update: The mail can have any ending, e.g. .com
, .ru
etc.