package re

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

1.14.0.tar.gz
md5=03f4a83100cb9229a796b85c698076e1
sha512=cd2cc39f951ca6b7be631bbb5531ed13bc040e629842671bf6fef3911b20ef1653fa9a1f0aa23b094d252cffc9a9efe7ffca69e50d362ab935bc0cc447548124

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 re_result : ?flags:flag list -> string -> ((Re__.Ast.cset, [ `Cased | `Uncased ]) Re__.Ast.gen, [ `Not_supported | `Parse_error ]) result
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. Prefer to use the non-raising version get_named_substring_opt

Sourceval get_named_substring_opt : regexp -> string -> groups -> string option

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