note
hippo
<p>This works for me. See also [id://1154672].</p>
<code>
use strict;
use warnings;
use Test::More tests => 2;
my $in = <<EOT;
ASDF {
tmp
foo_match
tmp
}
string2 {
tmp
}
string3 {
tmp
bar_match
tmp
}
EOT
my $re = '^ASDF {[^{]*foo_match[^}]*}';
like $in, qr/$re/m, 'foo_match found in ASDF';
$re =~ s/foo/bar/;
unlike $in, qr/$re/m, 'bar_match not found in ASDF although present in string3';
</code>
<div class="pmsig"><div class="pmsig-885521">
<hr /><p>🦛
</p>
</div></div>
11129177
11129177