-
-
Save anonymous/ac176060126cbd633c97 to your computer and use it in GitHub Desktop.
How do I compile this?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Core.Std | |
module Regex = Re2.Regex | |
let ls pattern = | |
let pat = Regex.create_exn pattern in | |
let matcher = Regex.matches pat in | |
Sys.ls_dir "." | |
|> List.filter ~f:matcher | |
|> List.iter ~f:(fun s -> print_string s; print_newline ()) | |
let () = | |
match In_channel.input_line stdin with | |
| None -> (print_string "No Input"; print_newline ()) | |
| Some pat -> ls pat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment