RosettaCodeData/Task/Regular-expressions/OCaml/regular-expressions-2.ml

5 lines
179 B
OCaml
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
#load "str.cma";;
let orig = "I am the original string";;
let result = Str.global_replace (Str.regexp "original") "modified" orig;;
(* result is now "I am the modified string" *)