in reply to How can I match this }\n} in perl

One approach (of many):

use strict; use warnings; use Test::More tests => 1; my $have = "foo}\n}"; my $re = qr/}\n}/; like $have, $re, 'Matched';

Update: reduced the regex to make it even simpler.