2012-04-13 112 views
0

需要提取開始和結束之間的所有內容。如何提取perl中兩個關鍵字之間的所有內容

如果沒有\ n,下面的代碼將起作用。

$mystring = "The start text always precedes \n the end of the text."; 
if($mystring =~ m/start(.*?)end/) { 
    print $1; 
} 

O/P應該是 - 文本總是先\ n中的

回答

相關問題