in reply to Pattern mattching

Or positive lookahead:
my $pattern = qr{\+(?=\d{6})}; $string =~ /$pattern/;