in reply to Need regexp to pick off second parenthetical item

#!/usr/bin/perl # http://perlmonks.org/?node_id=1185969 use strict; use warnings; my $sentto = 'Fred Flintstone (US) (fredf@gmail.com)'; $sentto =~ m/.+\K\(.*/; print "First: $`\nSecond: $&\n"

Replies are listed 'Best First'.
Re^2: Need regexp to pick off second parenthetical item
by cormanaz (Deacon) on Mar 26, 2017 at 15:10 UTC
    Awesome. I didn't know about \K.

      Regex operator  \K is only available from Perl version 5.10 onward.


      Give a man a fish:  <%-{-{-{-<