8.14.0.2
9.1.4 Regexp Match Results
Represents a successful match result from methods like
RX.match. The whole field corresponds to the overall
matched input (which can be a portion of the input for a rx_in
or RX.match_in match, for example). The captures
list contains portions of the overall match that correspond to
capture groups in the pattern. The capture_names field
maps capture-group names to indices, which count from 1.
The whole value and elements of captures are intended to be strings, byte strings, or ranges, depending on how the match is produced. For example, RX.match with a regexp in character mode on a string input will produce a RXMatch object whose whole is a string. The RX.match_range method produces a RXMatch object whose whole is a range.
A RXMatch object is Listable and Indexable. Its Listable.to_list conversion is same as [whole] ++ captures. Indexing by an integer accesses the same result as indexing the object’s list, but capture-group names (which are the keys of capture_names) can also be used as indices.
RXMatch(Bytes.copy(#"axz"), [], {})
RXMatch(Bytes.copy(#"axz"), [], {})
RXMatch(0 .. 3, [], {})