package re

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

Install

Dune Dependency

Authors

Maintainers

Sources

re-1.12.0.tbz
sha256=a01f2bf22f72c2f4ababd8d3e7635e35c1bf6bc5a41ad6d5a007454ddabad1d4
sha512=f0726826e1e677f7ecdf447d46d814a11d3844ec6e5c0527be8c73c7afdb08aacfca47ea764eda325bcd7064aff07c1d3441c935ee5a0fc99ede8707f81a451d

doc/re.pcre/Re_pcre/index.html

Module Re_pcreSource

  • deprecated Use Re.Pcre
include module type of struct include Re.Pcre end
Sourceexception Parse_error
Sourceexception Not_supported
Sourcetype regexp
Sourcetype flag = [
  1. | `CASELESS
  2. | `MULTILINE
  3. | `ANCHORED
  4. | `DOTALL
]
Sourcetype groups = Re.Group.t
Sourcetype split_result = Re.Pcre.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

Sourceval re : ?flags:flag list -> string -> (Re__.Ast.cset, [ `Cased | `Uncased ]) Re__.Ast.gen

re ~flags s creates the regexp s using the pcre syntax.

Sourceval regexp : ?flags:flag list -> string -> regexp

re ~flags s compiles the regexp s using the pcre syntax.

Sourceval extract : rex:regexp -> string -> string array

extract ~rex s executes rex on s and returns the matching groups.

Sourceval exec : rex:regexp -> ?pos:int -> string -> groups

Equivalent to Core.exec.

Sourceval get_substring : groups -> int -> string

Equivalent to Core.Group.get.

Sourceval names : regexp -> string array

Return the names of named groups.

Sourceval get_named_substring : regexp -> string -> groups -> string

Return the first matched named group, or raise Not_found.

Sourceval get_substring_ofs : groups -> int -> int * int

Equivalent to Core.Group.offset.

Sourceval pmatch : rex:regexp -> string -> bool

Equivalent to Core.execp.

Sourceval substitute : rex:Re__.Compile.re -> subst:(string -> string) -> string -> string
Sourceval full_split : ?max:int -> rex:regexp -> string -> split_result list
Sourceval split : rex:regexp -> string -> string list
Sourceval quote : string -> string

Deprecated

Sourcetype substrings = Re.Group.t
OCaml

Innovation. Community. Security.