package sihl

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file utils_regex.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
open Base

type t = Pcre.regexp

let of_string string = Pcre.regexp string

let test regexp string = Pcre.pmatch ~rex:regexp string

let extract_last regexp text =
  Pcre.extract_opt ~rex:regexp text
  |> Array.to_list |> List.tl |> Option.bind ~f:List.hd |> Option.join

module Pcre = Pcre
OCaml

Innovation. Community. Security.