Checking part of the mail suffix
I am checking for email addresses that might look something like this:
foo@bar.xx.com
but also
foo@bar.yy.com
I would like to check if it is present xx
or not. The first thing that came to mind was String.Contains
, but it would clearly match occurrences xx
in the string.
Is regexp the way to go? If so, please help me with the template.
Update: mail can have any ending, eg. .com
, .ru
etc.
source to share
You can use this pattern: \w+@\w+.xx.\w+
Help: http://regexr.com/
And if you want to check any email, it's best to see this link .
source to share