以下のように定義された変数があります。
my $variable = "This is related to NSQ outage, it is being handled along with all other NSQ alarms. Network team is working on it.";
いくつかのキーワードは次のとおり"is nsq this server"
です。
に 2 つ以上のキーワードがある場合、正規表現を$variable
使用できますか? true を返す可能性がありますか?
例:
- キーワードが「is nsq server」の場合: true
- キーワードが「nsq machine server」の場合: false
ありがとう、上記の質問は解決されたと思います。
そして、私は以下のようにさらに質問があります:
my $var="this is related to NSQ outage, and this is";
$var=~/((this|sth).*){2,}/, return true.
実際には に 'sth' はなく$var
、this
2 つある。
この状況で正規表現を false に戻すにはどうすればよいですか?