package ppx_regexp

  1. Overview
  2. Docs
Matching Regular Expressions with OCaml Patterns

Install

Authors

Maintainers

Sources

ppx_regexp-v0.5.1.tbz
sha256=25083bc47c6ca224b52d958e3272c938c1115895446ed526ca330f03a2d50ca8
sha512=e9e8888b8f4cf4f7b2aab38af8e835f716a5b973b7a48ae329daafcc80b705bc8f839f6f76364699804903cc7f9ae6d5d69d9cf0f257c007558ff9f0fbf6d357

Description

This syntax extension turns

match%pcre x with
| {|re1|} -> e1
...
| {|reN|} -> eN
| _ -> e0

into suitable invocations to the ocaml-re library. The patterns are plain strings of the form accepted by Re_pcre, except groups can be bound to variables using the syntax (?<var>...). The type of var will be string if a match is of the groups is guaranteed given a match of the whole pattern, and string option if the variable is bound to or nested below an optionally matched group.

Published: 09 Jun 2022

Dependencies (4)

  1. re >= "1.7.2"
  2. ppxlib >= "0.9.0"
  3. dune >= "1.11"
  4. ocaml >= "4.02.3"

Dev Dependencies (1)

  1. qcheck with-test

Used by

None

Conflicts

None