Guest User

Untitled

a guest
Dec 16th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. open Batteries
  2.  
  3. let compile (pattern: string) : Re.re =
  4. pattern |> Re_perl.re ~opts:[] |> Re.compile
  5.  
  6. let test (re: Re.re) (str: string) : bool = Re.execp re str
  7.  
  8. let exec (re: Re.re) (str: string) : string array option =
  9. Re.exec_opt re str |> Option.map Re.Group.all
  10.  
  11.  
  12. module Infix = struct
  13. let ( =~ ) = test
  14. end
Add Comment
Please, Sign In to add comment