0

たとえば、次を含むすべての行をフィルタリングするためにPerlで正規表現を使用する最良の方法は何/usr/libexec/postfixですか?

それはまたキャッチするでしょう、例えば:/usr/libexec/postfix/qmgr、、など?/usr/libexec/postfix/smtp/usr/libexec/postfix/local

4

1 に答える 1

3

これはうまくいくはずです:

if ($line =~ m{^/usr/libexec/postfix.*}) {
     print "Match!\n";
} else {
     print "No match\n";
}

作業例: http://codepad.org/jkVlISdv

于 2013-03-18T07:01:05.617 に答える