0

start と end の間のすべてを抽出する必要があります。

\n がない場合、以下のコードは機能します。

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

o/p は次のようにする必要があります - テキストは常に \n

4

1 に答える 1

0

研究perlre、特に/sモディファイア。

于 2012-04-13T00:22:52.200 に答える