Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

How can i Filter specific part of my mail?

$
0
0

 Regex CheckUnderscore = new Regex(@"(.*?)_(.*?)@ecABC.com");

string checkEmailString = "123_blahlbha@ecABC.com";

string emailClientCode = CheckUnderscore.Match(checkEmailString).Groups[1].Value;
 string emailEncodedCleintCode = CheckUnderscore.Match(checkEmailString).Groups[2].Value;

emailClientCode = 123

emailEncodedCleintCode = blablbha

which is something i want


but if checkEmailString = "blah_blahsopmethingwhahwha,123_blahlbha@ecABC.com,1234_blahlbasha@ecABCerere.com";

the emailclientCode and emailEncodedCleintCode will return wrong values.

all i wanna get is  

emailClientCode = 123

emailEncodedCleintCode = blablbha

thanks very much 


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>