複数の行に以下の文字列があります。コマンド出力から来ているので、1行にすることはできません。例えばのため:複数の行を含む文字列内の単語を含むものを削除します。
my $myString = "Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
when an unknown printer took a galley of type and scrambled it to make a
type specimen book. It has survived not only five centuries, but also
the leap into electronic typesetting, remaining essentially unchanged.
It was popularised in the 1960s"
私は単語までを含むものを取り除きたい、私は以下試してみましたが、動作していないよう
「スクランブル」。
if($myString =~ 's/.*(scrambled)//s')
{
print "Match: <$&>\n";
}
おかげで、これは...何 'unscrambled'文字列が含まれている場合について –
を働いていますか?私たちは '\ bscrambled \ b'を使います。 – ssr1012
@ ssr1012:正規表現を修正しました。ありがとう。 –