首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

这个正则表达式怎么写

2012-06-16 
这个正则表达式如何写?对于下面的字符串,我想分别获取冒号后的信息,如何写正则表达式Content-Type: applic

这个正则表达式如何写?
对于下面的字符串,我想分别获取冒号后的信息,如何写正则表达式

Content-Type: application/msword;
  name="readme.doc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
  filename=" readme.doc "


[解决办法]
看看这个能否达到要求

C# code
 Regex reg = new Regex(@"(?<=[::""][\s\t]*)[^\n"";;\s]+(?=[\s\t]*[;"";\n])");            string input = @"Content-Type: application/msword;  name=""readme.doc""Content-Transfer-Encoding: base64Content-Disposition: attachment;  filename="" readme.doc """;            foreach (Match m in reg.Matches(input))                Console.WriteLine(m.Value);//printapplication/mswordreadme.docbase64attachmentreadme.doc 

热点排行