`sig
type error =
Partial
| BadPartial
| BadPattern of string * int
| BadUTF8
| BadUTF8Offset
| MatchLimit
| RecursionLimit
| InternalError of string
exception Error of Pcre.error
exception Backtrack
exception Regexp_or of string * Pcre.error
type icflag
and irflag
and cflag =
[ `ANCHORED
| `AUTO_CALLOUT
| `CASELESS
| `DOLLAR_ENDONLY
| `DOTALL
| `EXTENDED
| `EXTRA
| `FIRSTLINE
| `MULTILINE
| `NO_AUTO_CAPTURE
| `NO_UTF8_CHECK
| `UNGREEDY
| `UTF8 ]
val cflags : Pcre.cflag list -> Pcre.icflag
val cflag_list : Pcre.icflag -> Pcre.cflag list
type rflag = [ `ANCHORED | `NOTBOL | `NOTEMPTY | `NOTEOL | `PARTIAL ]
val rflags : Pcre.rflag list -> Pcre.irflag
val rflag_list : Pcre.irflag -> Pcre.rflag list
val version : string
val config_utf8 : bool
val config_newline : char
val config_link_size : int
val config_match_limit : int
val config_match_limit_recursion : int
val config_stackrecurse : bool
type firstbyte_info = [ `ANCHORED | `Char of char | `Start_only ]
type study_stat = [ `Not_studied | `Optimal | `Studied ]
type regexp
external options : Pcre.regexp -> Pcre.icflag = "pcre_options_stub"
external size : Pcre.regexp -> int = "pcre_size_stub"
external studysize : Pcre.regexp -> int = "pcre_studysize_stub"
external capturecount : Pcre.regexp -> int = "pcre_capturecount_stub"
external backrefmax : Pcre.regexp -> int = "pcre_backrefmax_stub"
external namecount : Pcre.regexp -> int = "pcre_namecount_stub"
external names : Pcre.regexp -> string array = "pcre_names_stub"
external nameentrysize : Pcre.regexp -> int = "pcre_nameentrysize_stub"
external firstbyte : Pcre.regexp -> Pcre.firstbyte_info
= "pcre_firstbyte_stub"
external firsttable : Pcre.regexp -> string option = "pcre_firsttable_stub"
external lastliteral : Pcre.regexp -> char option = "pcre_lastliteral_stub"
external study_stat : Pcre.regexp -> Pcre.study_stat
= "pcre_study_stat_stub" [@@noalloc]
val get_stringnumber : Pcre.regexp -> string -> int
external get_match_limit : Pcre.regexp -> int option
= "pcre_get_match_limit_stub"
external get_match_limit_recursion : Pcre.regexp -> int option
= "pcre_get_match_limit_recursion_stub"
type chtables
external maketables : unit -> Pcre.chtables = "pcre_maketables_stub"
val regexp :
?study:bool ->
?limit:int ->
?limit_recursion:int ->
?iflags:Pcre.icflag ->
?flags:Pcre.cflag list ->
?chtables:Pcre.chtables -> string -> Pcre.regexp
val regexp_or :
?study:bool ->
?limit:int ->
?limit_recursion:int ->
?iflags:Pcre.icflag ->
?flags:Pcre.cflag list ->
?chtables:Pcre.chtables -> string list -> Pcre.regexp
val quote : string -> string
type substrings
val get_subject : Pcre.substrings -> string
val num_of_subs : Pcre.substrings -> int
val get_substring : Pcre.substrings -> int -> string
val get_substring_ofs : Pcre.substrings -> int -> int * int
val get_substrings : ?full_match:bool -> Pcre.substrings -> string array
val get_opt_substrings :
?full_match:bool -> Pcre.substrings -> string option array
val get_named_substring :
Pcre.regexp -> string -> Pcre.substrings -> string
val get_named_substring_ofs :
Pcre.regexp -> string -> Pcre.substrings -> int * int
type callout_data = {
callout_number : int;
substrings : Pcre.substrings;
start_match : int;
current_position : int;
capture_top : int;
capture_last : int;
pattern_position : int;
next_item_length : int;
}
type callout = Pcre.callout_data -> unit
val pcre_exec :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string -> ?pos:int -> ?callout:Pcre.callout -> string -> int array
val exec :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int -> ?callout:Pcre.callout -> string -> Pcre.substrings
val exec_all :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int -> ?callout:Pcre.callout -> string -> Pcre.substrings array
val next_match :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int -> ?callout:Pcre.callout -> Pcre.substrings -> Pcre.substrings
val extract :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int ->
?full_match:bool -> ?callout:Pcre.callout -> string -> string array
val extract_opt :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int ->
?full_match:bool ->
?callout:Pcre.callout -> string -> string option array
val extract_all :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int ->
?full_match:bool -> ?callout:Pcre.callout -> string -> string array array
val extract_all_opt :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int ->
?full_match:bool ->
?callout:Pcre.callout -> string -> string option array array
val pmatch :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string -> ?pos:int -> ?callout:Pcre.callout -> string -> bool
type substitution
val subst : string -> Pcre.substitution
val replace :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int ->
?itempl:Pcre.substitution ->
?templ:string -> ?callout:Pcre.callout -> string -> string
val qreplace :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int -> ?templ:string -> ?callout:Pcre.callout -> string -> string
val substitute_substrings :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int ->
?callout:Pcre.callout ->
subst:(Pcre.substrings -> string) -> string -> string
val substitute :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int ->
?callout:Pcre.callout -> subst:(string -> string) -> string -> string
val replace_first :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int ->
?itempl:Pcre.substitution ->
?templ:string -> ?callout:Pcre.callout -> string -> string
val qreplace_first :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int -> ?templ:string -> ?callout:Pcre.callout -> string -> string
val substitute_substrings_first :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int ->
?callout:Pcre.callout ->
subst:(Pcre.substrings -> string) -> string -> string
val substitute_first :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int ->
?callout:Pcre.callout -> subst:(string -> string) -> string -> string
val split :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int -> ?max:int -> ?callout:Pcre.callout -> string -> string list
val asplit :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int -> ?max:int -> ?callout:Pcre.callout -> string -> string array
type split_result =
Text of string
| Delim of string
| Group of int * string
| NoGroup
val full_split :
?iflags:Pcre.irflag ->
?flags:Pcre.rflag list ->
?rex:Pcre.regexp ->
?pat:string ->
?pos:int ->
?max:int -> ?callout:Pcre.callout -> string -> Pcre.split_result list
val foreach_line : ?ic:Stdlib.in_channel -> (string -> unit) -> unit
val foreach_file :
string list -> (string -> Stdlib.in_channel -> unit) -> unit
external unsafe_pcre_exec :
Pcre.irflag ->
Pcre.regexp ->
pos:int ->
subj_start:int -> subj:string -> int array -> Pcre.callout option -> unit
= "pcre_exec_stub_bc" "pcre_exec_stub"
val make_ovector : Pcre.regexp -> int * int array
end`