Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (17 sloc) 0.445 kB
(*
OCaml file with embedded ocamllex-generated code.
*)
#ext ocamllex
let digit = ['0'-'9']
rule ints = parse
| '-'? digit+ as s { int_of_string s :: ints lexbuf }
| _ { ints lexbuf }
| eof { [] }
#endext
let extract_ints s =
let lexbuf = Lexing.from_string s in
ints lexbuf
let main () =
let l = extract_ints " 123x456 -7!" in
List.iter (fun n -> Printf.printf "%i\n" n) l
let () = main ()
Jump to Line
Something went wrong with that request. Please try again.