From 2f8c17e0c852b4820547b591de5b182abc21773e Mon Sep 17 00:00:00 2001 From: "Petter A. Urkedal" Date: Sun, 4 Jun 2017 12:51:35 +0200 Subject: [PATCH] Add ppx_regexp.descr. --- ppx_regexp.descr | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 ppx_regexp.descr diff --git a/ppx_regexp.descr b/ppx_regexp.descr new file mode 100644 index 0000000..0ffaf12 --- /dev/null +++ b/ppx_regexp.descr @@ -0,0 +1,16 @@ +Matching Regular Expressions with OCaml Patterns + +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 `(?...)`. 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.