in reply to Re: Reusing a complex regexp in multiple spots, escaping the regexp
in thread Reusing a complex regexp in multiple spots, escaping the regexp

On a tangent, what is the benefit of (?(DEFINE) ...) constructs for repeated patterns here?

Intuitively, I would have opted for interpolating nested $variables holding qr// snippets, especially since I can make them more readable with /x and can unit test them individually.

But I'm curious to learn why you chose this way.

Is it about the handling of capture groups?

I tried to read the relevant docs, but they constantly mention recursion and I can't spot any here...

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