Regexp.Result
Matching results.
This handles the weird array returned by exec
or match'
.
val stop_index : t -> int
fold_groups f r acc
folds f
over the content of all capturing groups (named included) in r
starting with acc
. This is acc
if there is no group.
val fold_group_indices : (start:int -> stop:int -> 'a -> 'a) -> t -> 'a -> 'a
fold_group_indices f r acc
is like fold_groups
but f
is given the start
and stop
index of the group which indicate it spans the indices [start
;stop-1
] of input
.
Warning. The regexp needs the d
flag for this to yield results otherwise the function simply returns acc
.
fold_named_groups f r acc
folds f
over the content of named capturing groups in r
starting with acc
.
fold_named_group_indices f r acc
is like fold_named_groups
but f
is given the start
and stop
index of the group which indicate it spans the indices [start
;stop-1
] of input
.
Warning. The regexp needs the d
flag for this to yield results otherwise the function simply returns acc
.