我正在尝试用字符串捕获文本开头并以字符串结束,但匹配正则表达式在换行符处停止的问题。
我想抓住所有文字,包括从“StartFragment”到“EndFragment”的新行
<body lang=RU style='tab-interval:35.4pt'> <!--StartFragment--><span lang=EN-US style='font-size:11.0pt;line-height: 107%;font-family:"Calibri",sans-serif;mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font: minor-latin;mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi; mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA'>Sdfsd </span><u><span lang=EN-US style='font-size:18.0pt;line-height:107%;font-family: "Calibri",sans-serif;mso-ascii-theme-font:minor-latin;mso-fareast-font-family: Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi; color:red;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language: AR-SA'>sfsdfsfsdfsdf </span></u><b style='mso-bidi-font-weight:normal'><span lang=EN-US style='font-size:8.0pt;line-height:107%;font-family:"Calibri",sans-serif; mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font: minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language: EN-US;mso-bidi-language:AR-SA'>sdsdfsdfsdfsd</span></b><!--EndFragment--> </body>
我正在使用下一个正则表达式,但由于换行符没有捕获所有文本:
/<!--StartFragment-->.+<!--EndFragment-->/mi