Thursday 15 March 2012

c# - Regular expression to find a string included between two characters -



c# - Regular expression to find a string included between two characters -

i bad @ regex , to parse email address using c#.

if input user@domain.me.com, regex utilize extract "domain" part? there can multiple domains of different length.

it's not trivial parse email regex, because rules valid email complex; fortunately, don't need to: can utilize mailaddress class instead.

var address = new mailaddress("user@domain.me.com"); string domain = address.host.split('.')[0];

c# regex

No comments:

Post a Comment