RosettaCodeData/Task/Regular-expressions/OCaml/regular-expressions-2.ml
2024-10-16 18:07:41 -07:00

4 lines
179 B
OCaml

#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" *)