pcre2-ocaml offers library functions for string pattern matching and substitution, similar to the functionality offered by the Perl language.