http://qs321.pair.com?node_id=11121036


in reply to Can't figure out why capture group is not output by substitution regex

I'm not sure why I have to do that.

You have to do it because your second (inner) s/// resets the capture groups.


🦛

  • Comment on Re: Can't figure out why capture group is not output by substitution regex
  • Download Code

Replies are listed 'Best First'.
Re^2: Can't figure out why capture group is not output by substitution regex
by nysus (Parson) on Aug 24, 2020 at 16:14 UTC

    Ah, of course. Thanks.

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
    $nysus = $PM . ' ' . $MCF;
    Click here if you love Perl Monks