package ppx_regexp

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

Install

Dune Dependency

Authors

Maintainers

Sources

ppx_regexp-v0.5.0.tbz
sha256=5c80bee02ae3fd4eb1109267bc790d6b8c719f5be0e4973a96f8d92e5e07d8d0
sha512=620929b214756a57179e587fd9f5f01ec3ee7facc3510c254978aa9c65e0b12c96d3c8302d53e561ea1fb3a35f3b9949debf51562fc7c1ea7d05db151c6c1d81

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: 07 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