This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,13 @@
open Import
let%expect_test "iter" =
let re = Re.Posix.compile_pat "(ab)+" in
strings (Re.matches re "aabab aaabba dab ");
[%expect {| ["abab"; "ab"; "ab"] |}];
strings (Re.matches ~pos:2 ~len:7 re "abab ababab");
[%expect {| ["ab"; "abab"] |}];
strings (Re.matches re_empty "ab");
[%expect {| [""; ""; ""] |}];
strings (Re.matches (Re.compile (Re.rep (Re.char 'a'))) "cat");
[%expect {| [""; "a"; ""] |}]
;;