Module Oniguruma.RegSetSource

Sourcetype t

A set of regular expressions that can be searched simultaneously.

Sourceval create : _ regex array -> t

create regexes creates a regex set from regexes.

Ownership of regex internals is transferred to the regset (matching Oniguruma's C API). After creating the regset, use the set for searching instead of reusing those regex values directly.

search set string start range options searches string for the leftmost match across all regexes in set using ONIG_REGSET_POSITION_LEAD.

Returns Some (idx, region) where idx is the 0-based index of the matched regex from the array passed to create. Returns None on mismatch. Raises Error on other Oniguruma errors.