type error =
| Partial
| BadPattern of string * int
| BadUTF
| BadUTFOffset
| MatchLimit
| DepthLimit
| WorkspaceSize
| InternalError of string
exception Regexp_or of string * error
and cflag = [
| `ALLOW_EMPTY_CLASS
| `ALT_BSUX
| `ALT_CIRCUMFLEX
| `ALT_VERBNAMES
| `ANCHORED
| `AUTO_CALLOUT
| `CASELESS
| `DOLLAR_ENDONLY
| `DOTALL
| `DUPNAMES
| `ENDANCHORED
| `EXTENDED
| `EXTENDED_MORE
| `FIRSTLINE
| `LITERAL
| `MATCH_INVALID_UTF
| `MATCH_UNSET_BACKREF
| `MULTILINE
| `NEVER_BACKSLASH_C
| `NEVER_UCP
| `NEVER_UTF
| `NO_AUTO_CAPTURE
| `NO_AUTO_POSSESS
| `NO_DOTSTAR_ANCHOR
| `NO_START_OPTIMIZE
| `NO_UTF_CHECK
| `UCP
| `UNGREEDY
| `USE_OFFSET_LIMIT
| `UTF
]
type rflag = [
| `ANCHORED
| `COPY_MATCHED_SUBJECT
| `DFA_RESTART
| `DFA_SHORTEST
| `ENDANCHORED
| `NOTBOL
| `NOTEMPTY
| `NOTEMPTY_ATSTART
| `NOTEOL
| `NO_JIT
| `NO_UTF_CHECK
| `PARTIAL_HARD
| `PARTIAL_SOFT
]
val config_unicode : bool
val config_newline : char
val config_link_size : int
val config_match_limit : int
val config_depth_limit : int
val config_stackrecurse : bool
type firstcodeunit_info = [
| `ANCHORED
| `Char of char
| `Start_only
]
val capturecount : regexp -> int
val backrefmax : regexp -> int
val nameentrysize : regexp -> int
val names : regexp -> string array
val lastcodeunit : regexp -> char option
val get_stringnumber : regexp -> string -> int
val regexp_or :
?limit:int ->
?depth_limit:int ->
?iflags:icflag ->
?flags:cflag list ->
?chtables:chtables ->
string list ->
regexp
val quote : string -> string
val get_substring_ofs : substrings -> int -> int * int
val get_substrings : ?full_match:bool -> substrings -> string array
val get_opt_substrings : ?full_match:bool -> substrings -> string option array
type callout_data = {
callout_number : int;
substrings : substrings;
start_match : int;
current_position : int;
capture_top : int;
capture_last : int;
pattern_position : int;
next_item_length : int;
}
val pcre2_match :
?iflags:irflag ->
?flags:rflag list ->
?rex:regexp ->
?pat:string ->
?pos:int ->
?callout:callout ->
string ->
int array
val pcre2_dfa_match :
?iflags:irflag ->
?flags:rflag list ->
?rex:regexp ->
?pat:string ->
?pos:int ->
?callout:callout ->
?workspace:int array ->
string ->
int array
val pmatch :
?iflags:irflag ->
?flags:rflag list ->
?rex:regexp ->
?pat:string ->
?pos:int ->
?callout:callout ->
string ->
bool
val qreplace :
?iflags:irflag ->
?flags:rflag list ->
?rex:regexp ->
?pat:string ->
?pos:int ->
?templ:string ->
?callout:callout ->
string ->
string
val substitute_substrings :
?iflags:irflag ->
?flags:rflag list ->
?rex:regexp ->
?pat:string ->
?pos:int ->
?callout:callout ->
subst:(substrings -> string) ->
string ->
string
val substitute :
?iflags:irflag ->
?flags:rflag list ->
?rex:regexp ->
?pat:string ->
?pos:int ->
?callout:callout ->
subst:(string -> string) ->
string ->
string
val qreplace_first :
?iflags:irflag ->
?flags:rflag list ->
?rex:regexp ->
?pat:string ->
?pos:int ->
?templ:string ->
?callout:callout ->
string ->
string
val substitute_substrings_first :
?iflags:irflag ->
?flags:rflag list ->
?rex:regexp ->
?pat:string ->
?pos:int ->
?callout:callout ->
subst:(substrings -> string) ->
string ->
string
val substitute_first :
?iflags:irflag ->
?flags:rflag list ->
?rex:regexp ->
?pat:string ->
?pos:int ->
?callout:callout ->
subst:(string -> string) ->
string ->
string
val split :
?iflags:irflag ->
?flags:rflag list ->
?rex:regexp ->
?pat:string ->
?pos:int ->
?max:int ->
?callout:callout ->
string ->
string list
val asplit :
?iflags:irflag ->
?flags:rflag list ->
?rex:regexp ->
?pat:string ->
?pos:int ->
?max:int ->
?callout:callout ->
string ->
string array
type split_result =
| Text of string
| Delim of string
| Group of int * string
| NoGroup
val foreach_line : ?ic:in_channel -> (string -> unit) -> unit
val foreach_file : string list -> (string -> in_channel -> unit) -> unit
val unsafe_pcre2_match :
irflag ->
regexp ->
pos:int ->
subj_start:int ->
subj:string ->
int array ->
callout option ->
unit
val make_ovector : regexp -> int * int array
val unsafe_pcre2_dfa_match :
irflag ->
regexp ->
pos:int ->
subj_start:int ->
subj:string ->
int array ->
callout option ->
workspace:int array ->
unit