in reply to Re^2: How to know that a regexp matched, and get its capture groups?
in thread How to know that a regexp matched, and get its capture groups?

> I didn't expect this many answers, to be honest...

Because the problem is not easy to grasp normally one knows beforehand if captures are expected.

And the documentation is accurate.

My last solution here should fix the fake capture issue in a straight forward way, without any performance or version penalty.

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re^3: How to know that a regexp matched, and get its capture groups?

Replies are listed 'Best First'.
Re^4: How to know that a regexp matched, and get its capture groups?
by Anonymous Monk on Jan 10, 2023 at 17:48 UTC

    > Because the problem is not easy to grasp normally one knows beforehand if captures are expected.

    Very much true. And for the fake captures issue, the callback knows (is written for) the regexp it is attached to, so it simply ignores any arguments passed. So it is a non-issue in practice.