110,538
社区成员
发帖
与我相关
我的任务
分享
((?<=helloworld:myname is tianya)[\s\S]+(?=-----))
((?<=\r\n)[\s\S]+(?=-----))
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
string strText = "helloworld:myname is tianya\r\n\r\nMIME-Version: 1.0\r\nContent-Type: Multipart/report;\r\nreport-type=delivery-status;\r\n\r\n-----Content-Description: Delivery error report";
Console.WriteLine(strText);
Console.WriteLine("正则表达式匹配的结果如下:");
Console.WriteLine(Regex.Match(strText, @"(?<result>MIME-Version[\s\S]+(?=-----))").Groups[0].ToString()/*.Result("${result}")*/);
Console.ReadLine();
}
}
}
MIME-Version[\s\S]+(?=---)