package dune-private-libs

  1. Overview
  2. Docs
Private libraries of Dune

Install

Dune Dependency

Authors

Maintainers

Sources

dune-3.15.3.tbz
sha256=3c27c7676414056f0368a71fdc670d2b0a59898090c78a1b68230984e5beb713
sha512=c88ac7a6ed9334a4bc6231ecfb0efaa961dda99bc386fd5b92505151ff833dfaf058d75305fbb64c496e570058ec9000ac6add06dda7a395e757e924af1d1a7f

doc/dune-private-libs.dune_re/Dune_re/Posix/index.html

Module Dune_re.PosixSource

References:

Example of how to use this module (to parse some IRC logs):

type msg = {
  time:string;
  author:string;
  content:string;
}

let re = Core.compile (Re_posix.re "([^:].*:[^:]*:[^:]{2})<.([^>]+)> (.+)$")

(* parse a line *)
let match_line line =
  try
    let substrings = Core.exec re line in
    let groups = Core.get_all substrings in
    (* groups can be obtained directly by index within [substrings] *)
    Some {time=groups.(1); author=groups.(2); content=groups.(3)}
  with Not_found ->
    None (* regex didn't match *)
Sourceexception Parse_error
Sourceexception Not_supported

Errors that can be raised during the parsing of the regular expression

Sourcetype opt = [
  1. | `ICase
  2. | `NoSub
  3. | `Newline
]
Sourceval re : ?opts:opt list -> string -> Dune_re__.Core.t

Parsing of a Posix extended regular expression

Sourceval compile : Dune_re__.Core.t -> Dune_re__.Core.re

compile r is defined as Core.compile (Core.longest r)

Sourceval compile_pat : ?opts:opt list -> string -> Dune_re__.Core.re

compile_pat ?opts regex compiles the Posix extended regular expression regexp

OCaml

Innovation. Community. Security.