package oniguruma
Library
Module
Module type
Parameter
Class
Class type
Bindings to K.Kosako's Oniguruma library. Also see the Oniguruma API documentation.
A regular expression. The phantom type parameter indicates the encoding, so that regular expressions for different encodings may not be mixed.
module Encoding : sig ... end
Character encodings.
module Options : sig ... end
Regex options.
module Syntax : sig ... end
The syntax type.
module Region : sig ... end
Match results.
val create :
string ->
Options.compile_time Options.t ->
'enc Encoding.t ->
Syntax.t ->
('enc t, string) result
create pattern options encoding syntax
creates a regex.
val search :
'enc t ->
string ->
int ->
int ->
Options.search_time Options.t ->
Region.t option
search regex string start range option
searches String.sub string start range
for regex
. Raises Error
if there is an error (other than a mismatch).
val match_ :
'enc t ->
string ->
int ->
Options.search_time Options.t ->
Region.t option
match_ regex string pos options
matches regex
against string
at position pos
. Raises Error
if there is an error (other than a mismatch).
val num_captures : _ t -> int
The number of capture groups in the regex. The entire match itself does not count as a capture group.
val name_to_group_numbers : _ t -> string -> int array
name_to_group_numbers regex name
is the group number array of name
in regex
.