Open
Description
https://www.pcre.org/original/doc/html/pcrepattern.html and search for Recording which path was taken
. Would need to add some additional bindings to LibPCRE
and expose this value via MatchData#mark
. Something like:
match = /X(*:A)Y|X(*:B)Z/.match("XZ").not_nil!
match.mark # => "B"
Related to #8199, one con of this would be locking us into PCRE
, given I'm not so sure other engines support it. However maybe #3852 would fix it by optimizing the regex to be more performant?
Activity