正则表达式,请帮看看 有这样的字符串From: "exmaple" <[email protected]>怎么把这字符串分出[email protected]谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 "(?i)[a-z]+@\d+\.com"多给些例子 string s = "From: \"exmaple\" <[email protected]>"; Match match = new Regex(".+<(.+)>").Match(s); Console.WriteLine(match.Groups[1]); try...string test = "From: \"exmaple\" <[email protected]>";Regex reg = new Regex(@"(?is)from:[^<>]*<([^<>]*)>");MatchCollection mc = reg.Matches(test);foreach (Match m in mc){ richTextBox2.Text = m.Groups[1].Value + "\n";} 最简单的代码: string temp3 = @"From: "+"exmaple"+" <[email protected]>"; string[] temp4 = temp3.Split('<','>'); string strYouWantGet = temp4[1]; 这个要用正则表达式?你只是想取<>里面的值啊。 关于WPF中控件的一些疑惑,求指导(急急急!!!) 关于从txt文本读入 用哪些api的什么方法去获取系统信息 c#怎么实现这样的自适应功能 datagridview新增空白行的问题???? 求一 数据邦定方法 winfrom 提取一段html中的指定内容,并且获得之前的链接 给我个用C#写的在C盘创建一个文件夹的类 一个简单得画图问题 数据写入问题? 怎么限制自定义控件的调用? 关于Marshal.PtrToStructure出错的问题!!!求解答!!!
多给些例子
Match match = new Regex(".+<(.+)>").Match(s); Console.WriteLine(match.Groups[1]);
Regex reg = new Regex(@"(?is)from:[^<>]*<([^<>]*)>");
MatchCollection mc = reg.Matches(test);
foreach (Match m in mc)
{
richTextBox2.Text = m.Groups[1].Value + "\n";
}
string temp3 = @"From: "+"exmaple"+" <[email protected]>";
string[] temp4 = temp3.Split('<','>');
string strYouWantGet = temp4[1];