c:\@Work\Perl\monks>perl -wMstrict -le "use 5.010; ;; use warnings; use strict; ;; use Test::More 'no_plan'; use Test::NoWarnings; ;; my @tests = ( [ 'is `my ` that `also one` too', 'is `my &lgt;string>` that `also &lgt;this> one` too', ], [ 'is `not one', 'is `not one', ], [ 'is \`my that `but one` yes', 'is \`my that `but &lgt;this> one` yes', ], [ 'is \\\\`my that `but one` no', 'is \\\\`my &lgt;this> that `but one` no', ], ); ;; VECTOR: for my $ar_vector (@tests) { if (not ref $ar_vector) { note $ar_vector; next VECTOR; } ;; my ($string, $expected) = @$ar_vector; ;; (my $got = $string) =~ s{ (? '$expected'}; } ;; done_testing; " ok 1 - 'is `my ` that `also one` too' -> 'is `my &lgt;string>` that `also &lgt;this> one` too' ok 2 - 'is `not one' -> 'is `not one' ok 3 - 'is \`my that `but one` yes' -> 'is \`my that `but &lgt;this> one` yes' ok 4 - 'is \\`my that `but one` no' -> 'is \\`my &lgt;this> that `but one` no' 1..4 ok 5 - no warnings 1..5