我想在分隔符之間獲取數據並在匹配中包含分隔符。正則表達式匹配包含分隔符的多行文本
實施例文本:
>>> Possible error is caused by the segmentation fault
provided detection report:
<detection-report>
This is somthing that already in the report.
just an example report.
</detection-report>
---------------------------------------------
have a nice day
我當前的代碼是:
if($oopsmessage =~/(?<=<detection-report>)((.|\n|\r|\s)+)(?=<\/detection-report>)/) {
$this->{'detection_report'} = $1;
}
它檢索以下各項:
This is something that already in the report. just an example report.
如何包含檢測報告分隔符?