package re

  1. Overview
  2. Docs
val all : ?pos:int -> ?len:int -> Re__.Compile.re -> string -> Group.t Seq.t

Same as Re.all but returns an iterator.

Examples:

# let regex = Re.compile Re.(seq [str "my"; blank; word(rep alpha)]);;
val regex : re = <abstr>

# Re.Seq.all regex "my head, my shoulders, my knees, my toes ...";;
- : Re.Group.t Seq.t = <fun>
  • since 1.10.0
val matches : ?pos:int -> ?len:int -> Re__.Compile.re -> string -> string Seq.t

Same as Re.matches, but returns an iterator.

Example:

# let regex = Re.compile Re.(seq [str "my"; blank; word(rep alpha)]);;
val regex : re = <abstr>

# Re.Seq.matches regex "my head, my shoulders, my knees, my toes ...";;
- : string Seq.t = <fun>
  • since 1.10.0
val split : ?pos:int -> ?len:int -> Re__.Compile.re -> string -> string Seq.t

Same as Re.split but returns an iterator.

Example:

# let regex = Re.compile (Re.char ',');;
val regex : re = <abstr>

# Re.Seq.split regex "Re,Ocaml,Jerome Vouillon";;
- : string Seq.t = <fun>
  • since 1.10.0
val split_delim : ?pos:int -> ?len:int -> Re__.Compile.re -> string -> string Seq.t

Same as Re.split_delim but returns an iterator.

Example:

# let regex = Re.compile (Re.char ',');;
val regex : re = <abstr>

# Re.Seq.split regex "Re,Ocaml,Jerome Vouillon";;
- : string Seq.t = <fun>
  • since 1.11.1
val split_full : ?pos:int -> ?len:int -> Re__.Compile.re -> string -> [ `Text of string | `Delim of Group.t ] Seq.t

Same as Re.split_full but returns an iterator.

Example:

# let regex = Re.compile (Re.char ',');;
val regex : re = <abstr>

# Re.Seq.split_full regex "Re,Ocaml,Jerome Vouillon";;
- : Re.split_token Seq.t = <fun>
  • since 1.10.0
OCaml

Innovation. Community. Security.