package re

  1. Overview
  2. Docs
RE is a regular expression library for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

ocaml-re-1.3.0.tar.gz
sha256=fc6dc2fd6788213a7efee41d2797e7faff3f59b785ed98d00c0bdeeeb144b3bd
md5=c206c50f4c89342953dacf34def8d15d

doc/re.pcre/Re_pcre/index.html

Module Re_pcre

type regexp = Re.re
type flag = [
  1. | `CASELESS
  2. | `MULTILINE
  3. | `ANCHORED
]
type substrings = Re.substrings
type split_result =
  1. | Text of string
    (*

    Text part of splitted string

    *)
  2. | Delim of string
    (*

    Delimiter part of splitted string

    *)
  3. | Group of int * string
    (*

    Subgroup of matched delimiter (subgroup_nr, subgroup_str)

    *)
  4. | NoGroup
    (*

    Unmatched subgroup

    *)

Result of a Pcre.full_split

val re : ?flags:flag list -> string -> Re.t
val regexp : ?flags:flag list -> string -> regexp
val extract : rex:regexp -> string -> string array
val exec : rex:regexp -> ?pos:int -> string -> substrings
val get_substring : substrings -> int -> string
val get_substring_ofs : substrings -> int -> int * int
val pmatch : rex:regexp -> string -> bool
val substitute : rex:Re.re -> subst:(string -> string) -> string -> string
val full_split : ?max:int -> rex:regexp -> string -> split_result list
val split : rex:regexp -> string -> string list
val quote : string -> string
OCaml

Innovation. Community. Security.