C# 用于选择特定文本的正则表达式

C# 用于选择特定文本的正则表达式,c#,regex,c#-4.0,c#-3.0,C#,Regex,C# 4.0,C# 3.0,在C#中使用正则表达式。 你能帮忙吗 使用系统; 班级计划 { 静态void Main() { string dummyString=“虚拟警报:3/3警报已解决 ;问题警报:您是否遇到问题,或者您的音量是否低于正常值?”+ “是警报将于2018年9月1日下午1:08和10:00关闭;问题警报:您是否喝了更多液体?”+ “是警报于2019年9月10日下午1:08关闭,2017年9月10日进行了Ram支持访问,重量90.2kg(干)。”+ “达到TW。无外周水肿。根据患者病史,血压在常规范围

在C#中使用正则表达式。

你能帮忙吗

使用系统;
班级计划
{
静态void Main()
{
string dummyString=“虚拟警报:3/3警报已解决
;问题警报:您是否遇到问题,或者您的音量是否低于正常值?”+
“是警报将于2018年9月1日下午1:08和10:00关闭;问题警报:您是否喝了更多液体?”+
“是警报于2019年9月10日下午1:08关闭,2017年9月10日进行了Ram支持访问,重量90.2kg(干)。”+
“达到TW。无外周水肿。根据患者病史,血压在常规范围内。尿量1050ml。此时无PO液体限制。”+
“患者确实忘记了提交流程图。在一周内通过流程图审查监控UF趋势。Michelle Mayhew Smith,RN。”;
//用绳子,分开
var splitted=dummyString.Split(新字符串[]{“
;”},StringSplitOptions.None);
Console.WriteLine(拆分[Splited.Length-1]);
//使用String.LastIndexOf和String.Substring
int lastIndex=dummyString.LastIndexOf(
;);
Console.WriteLine(dummyString.Substring(lastIndex+5));
}
}
写两次:

2017年9月10日进行的Ram支持访问,重量90.2kg(干燥)。实现了TW。无周围水肿。根据患者病史,血压在常规范围内。尿量1050ml。此时无PO油液阻塞。病人确实忘了带流程图。在一周内通过流程图审查监控UF趋势。Michelle Mayhew Smith,注册护士


为什么不使用一个用于解析HTML的库,比如HtmlAgilityPack?或按

?你能解释一下吗。。或者举个例子,你显然需要最后一个

。如果是这样,请在下面检查我的答案。关于
+
符号,请注意
“bla”+“bla”
“blabla”
相同。
+
所做的就是将这些字符串连接在一起
<b>Dummy Alerts: </b>3/3Alerts have been addressed&#10; Question Alert: Have you had problems or are your volumes lower than normal?  " +
            "Yes Alert is closed on 01/09/2018 at 01:08 PM&#10; Question Alert: Have you been drinking more fluid? " +
            " Yes Alert is closed on 10/09/2019 at 01:08 PM&#10;&#10;Ram support visit performed 10/9/17,  Weight 90.2kg (dry). " +
            "TW achieved. No peripheral edema. BP within routine range per patient history. Urine output 1050ml. No PO fluid restriction at this time. " +
            "Patient did forget to bring in flow sheets.  Monitor UF trend with flow sheet review in one week. Michelle Mayhew Smith, RN."
 Ram support visit performed 10/9/17,  Weight 90.2kg (dry).
            TW achieved. No peripheral edema. BP within routine range per patient history. Urine output 1050ml. No PO fluid restriction at this time.
            Patient did forget to bring in flow sheets.Monitor UF trend with flow sheet review in one week. Michelle Mayhew Smith, RN.
using System;

class Program
{
    static void Main()
    {
        string dummyString = "<b>Dummy Alerts: </b>3/3Alerts have been addressed&#10; Question Alert: Have you had problems or are your volumes lower than normal?  " +
            "Yes Alert is closed on 01/09/2018 at 01:08 PM&#10; Question Alert: Have you been drinking more fluid? " +
            " Yes Alert is closed on 10/09/2019 at 01:08 PM&#10;&#10;Ram support visit performed 10/9/17,  Weight 90.2kg (dry). " +
            "TW achieved. No peripheral edema. BP within routine range per patient history. Urine output 1050ml. No PO fluid restriction at this time. " +
            "Patient did forget to bring in flow sheets.  Monitor UF trend with flow sheet review in one week. Michelle Mayhew Smith, RN.";

        // With String.Split    
        var splitted = dummyString.Split(new string[]{"&#10;"}, StringSplitOptions.None);
        Console.WriteLine(splitted[splitted.Length-1]);

        // With String.LastIndexOf & String.Substring
        int lastIndex = dummyString.LastIndexOf("&#10;");
        Console.WriteLine(dummyString.Substring(lastIndex+5));
    }
}