package mparser

  1. Overview
  2. Docs
A simple monadic parser combinator library

Install

Dune Dependency

Authors

Maintainers

Sources

mparser-1.2.3.tar.gz
sha256=dd08c884ea6e7d60a84613433ea20e7e198a8f90edad5064e4c0bc1ebc2b9669
md5=6e60c1fabb5d51482c664aa1bc8abc95

doc/mparser.pcre/MParser_PCRE/Regexp/index.html

Module MParser_PCRE.Regexp

A pluggable regular expression engine.

type t

A compiled regular expression.

type substrings

Substrings matched by a regular expression.

val make : string -> t

Compiles a regular expression.

val get_substring : substrings -> int -> string option

Extracts a single substring. Returns None if the group did not match.

val get_all_substrings : substrings -> string array

Extracts all the matched substrings. Includes the full match at index 0. If a subpattern did not capture a substring, the empty string is returned in the corresponding position instead.

val exec : rex:t -> pos:int -> Bytes.t -> substrings option

Attemts to match the byte-buffer with a regular expression, starting from the position pos. Returns the matched substrings or None on failure.

OCaml

Innovation. Community. Security.