package ochre
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=a8e38fbcd22fbb68b0f7d93b36a2ba1670e8bd061b43a0177226738307183a32
sha512=7b344c3812be283b0101078564e564732f878ad226c7ce0212c9e9139fb41a291e4d31ad52c949f2978c48e04240d4d22b5b4ae63808e15a21c44a2fbeed8a22
doc/ochre.oniguruma/Oniguruma/index.html
Module OnigurumaSource
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.
The exception raised upon Oniguruma errors.
Per-call match parameters.
val create :
string ->
Options.compile_time Options.t ->
'enc Encoding.t ->
Syntax.t ->
('enc t, string) resultcreate pattern options encoding syntax creates a regex.
val search :
'enc t ->
string ->
int ->
int ->
Options.search_time Options.t ->
Region.t optionsearch regex string start range option searches String.sub string start range for regex. Raises Error if there is an error (other than a mismatch).
match_ regex string pos options matches regex against string at position pos. Raises Error if there is an error (other than a mismatch).
val search_with_param :
'enc t ->
string ->
int ->
int ->
Options.search_time Options.t ->
MatchParam.t ->
Region.t optionLike search but with per-call match parameters.
val match_with_param :
'enc t ->
string ->
int ->
Options.search_time Options.t ->
MatchParam.t ->
Region.t optionLike match_ but with per-call match parameters.
val scan :
_ t ->
string ->
Options.search_time Options.t ->
(int -> int -> Region.t -> bool) ->
intscan regex string options callback finds all non-overlapping matches of regex in string. For each match, callback count pos region is called where count is the 1-based match number and pos is the byte offset. Return true from callback to continue scanning, false to stop. Returns the number of matches found.
The number of capture groups in the regex. The entire match itself does not count as a capture group.
name_to_group_numbers regex name is the group number array of name in regex.
true if unnamed group captures are active for this regex. When Options.dont_capture_group is used with named groups present, this returns false.
The compile-time options the regex was created with.
foreach_name regex f calls f name group_numbers for each named capture group. Return true from f to continue iteration, false to stop early.
name_to_backref_number regex name region resolves a named capture to the specific group number that matched in region. Useful when multiple groups share a name. Raises Error if the name is not found.
The Oniguruma version string. This is the version of the underlying C library, not this OCaml binding library.