Home: Perl Programming Help: Intermediate:
A pattern question



zatlas1
User

Jan 30, 2018, 10:19 AM


Views: 4302
A pattern question

Hi All
I've encountered this pattern


Code
if ($aa =~ /(?(DEFINE)(?<optional_a>a?))^(?&optional_a)a$/x)


I pretty much understand, or could find in perldoc, an explanation for all components of that pattern. I assume that there is an explanation for what I could not find.

Could somebody point me the explanation of this component:
(DEFINE)

Thank you
ZA


FishMonger
Veteran / Moderator

Jan 30, 2018, 12:02 PM


Views: 4298
Re: [zatlas1] A pattern question

It's documented in perlretut.
https://perldoc.perl.org/perlretut.html#Defining-named-patterns


zatlas1
User

Jan 30, 2018, 12:08 PM


Views: 4296
Re: [FishMonger] A pattern question

Thank you
Don't know how I missed it
ZA