Commits

camlspotter committed 339c850

escape test

  • Participants
  • Parent commits ddc1b48

Comments (0)

Files changed (1)

test/test_regexp.ml

 let _ = assert (("HeLlO" =~ <:m<hello/i>>) <> None)
 
 let _ = assert (("HeLlO" =~ <:m<hello>>) = None)
+
+let () =
+  match "http://www.www.com" =~ <:m<http:\/\/([^.]+)\.([^.]+)\.([^.]+)>> with
+  | None -> assert false
+  | Some res -> 
+      assert (res#_1 = "www"
+           && res#_2 = "www"
+           && res#_3 = "com")