in reply to Doing by global regex does not work as on debug

Note that this was also posted in p5p, where it was noted that the example as given does not compile.

  • Comment on Re: Doing by global regex does not work as on debug

Replies are listed 'Best First'.
Re^2: Doing by global regex does not work as on debug
by LanX (Saint) on Dec 05, 2021 at 18:46 UTC
    > the example as given does not compile.

    there is a quote missing, yes!

    ... apart from this it "works".

    DB<324> $str='kklmn' # end quote added DB<325> $str=~ s/(?=(kkl))(?(1)\g1|mn)/***/g DB<326> print $str ***mn DB<327>

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery