Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
How do our code evaluations in regex refer to the regex group captured, by name and/or relative way ? Try such
How is the correct Perl's way ?
to only get failure.'foo' =~ /(?'name'(?=o)(\w+))(?{print $name})/ # or 'foo' =~ /(?'name'(?=o)(\w+))(?{print $-1})/ Number found where operator expected at (eval 23)
How is the correct Perl's way ?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Code expressions in regex refer to the regex group captured, by name / relative
by haukex (Archbishop) on Jan 14, 2022 at 01:49 UTC | |
Re: Code expressions in regex refer to the regex group captured, by name / relative
by LanX (Saint) on Jan 14, 2022 at 02:13 UTC |
Back to
Seekers of Perl Wisdom