https://github.com/EasyCrypt/easycrypt
Revision ddf604b2725ed44db66e64ff4f97c89281b3a50a authored by François Dupressoir on 24 July 2017, 17:17:56 UTC, committed by François Dupressoir on 24 July 2017, 17:17:56 UTC
1 parent f173dc4
Raw File
Tip revision: ddf604b2725ed44db66e64ff4f97c89281b3a50a authored by François Dupressoir on 24 July 2017, 17:17:56 UTC
Fixing vonNeumann
Tip revision: ddf604b
ecRegexp.mli
(* --------------------------------------------------------------------
 * Copyright (c) - 2012--2016 - IMDEA Software Institute
 * Copyright (c) - 2012--2017 - Inria
 *
 * Distributed under the terms of the CeCILL-C-V1 license
 * -------------------------------------------------------------------- *)

(* -------------------------------------------------------------------- *)
type error 
type regexp 
type subst
type match_

type split =
  | Text  of string
  | Delim of string

exception Error of error

type oregexp = [`C of regexp | `S of string]
type osubst  = [`C of subst  | `S of string]

(* -------------------------------------------------------------------- *)
val quote  : string -> string
val regexp : string -> regexp
val subst  : string -> subst

(* -------------------------------------------------------------------- *)
module Match : sig
  val count  : match_ -> int
  val group  : match_ -> int -> string option
  val groups : match_ -> (string option) array
  val offset : match_ -> int -> (int * int) option
end

(* -------------------------------------------------------------------- *)
val exec    : ?pos:int -> oregexp -> string -> match_ option
val match_  : ?pos:int -> oregexp -> string -> bool
val split   : ?pos:int -> oregexp -> string -> split list
val split0  : ?pos:int -> oregexp -> string -> string list
val sub     : oregexp -> osubst -> string -> string
val extract : oregexp -> string -> (string option array) array
back to top