Commit d1460796 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2005-01-28 13:48:36 by afrisch] Empty log message

Original author: afrisch
Date: 2005-01-28 13:48:36+00:00
parent 7a9989e4
......@@ -148,7 +148,7 @@ OBJECTS = \
misc/html.cmo \
\
types/sortedList.cmo types/boolean.cmo types/ident.cmo \
types/intervals.cmo types/chars.cmo types/atoms.cmo \
types/intervals_int.cmo types/intervals.cmo types/chars.cmo types/atoms.cmo \
types/normal.cmo \
types/types.cmo types/sample.cmo types/sequence.cmo types/patterns.cmo \
types/builtin_defs.cmo \
......
open Encodings.Utf8
let pcre_replace ~rex ?templ s =
match templ with
| None -> mk (Pcre.replace ~rex (get_str s))
| Some templ ->
mk (Pcre.replace ~rex ~templ:(get_str templ) (get_str s))
let pcre_extract ~rex s = Array.map mk (Pcre.extract ~rex (get_str s))
let pcre_regexp s = Pcre.regexp ~flags:[`UTF8] s
let pcre_split ~rex s = List.map mk (Pcre.split ~rex (get_str s))
(* Wrappers for some Pcre functions working on Utf8.t values.
* Given Pcre.regexp regular expressions should be compiled with `UTF8 flag
* or with pcre_regexp below *)
open Encodings.Utf8
val pcre_regexp: string -> Pcre.regexp (* compile using `UTF8 flag *)
val pcre_replace: rex:Pcre.regexp -> ?templ:t -> t -> t
val pcre_extract: rex:Pcre.regexp -> t -> t array
val pcre_split: rex:Pcre.regexp -> t -> t list
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment