Chapter 27 The str library: regular expressions and string processing

The str library provides high-level string processing functions,some based on regular expressions. It is intended to support the kindof file processing that is usually performed with scripting languagessuch as awk, perl or sed.

Programs that use the str library must be linked as follows:

  1. ocamlc other options str.cma other files
  2. ocamlopt other options str.cmxa other files

For interactive use of the str library, do:

  1. ocamlmktop -o mytop str.cma
  2. ./mytop

or (if dynamic linking of C libraries is supported on your platform),start ocaml and type #load "str.cma";;.