Python Regular Expression Pattern Matching Ocaml Random Number