Module captures

Provides types for dealing with capturing groups.

Capturing groups refer to sub-patterns of regexes that some regex engines can report matching offsets for. For example, matching [a-z]([0-9]+) against a789 would give a789 as the overall match (for the implicit capturing group at index 0) and 789 as the match for the capturing group ([0-9]+) (an explicit capturing group at index 1).

Not all regex engines can report match offsets for capturing groups. Indeed, to a first approximation, regex engines that can report capturing group offsets tend to be quite a bit slower than regex engines that can't. This is because tracking capturing groups at search time usually requires more "power" that in turn adds overhead.

Other regex implementations might call capturing groups "submatches."

Overview

The main types in this module are:

Structs