

Task

   match a string against a regular expression
   substitute part of a string using a regular expression


let T be indexed text;
let T be "A simple string";
if T matches the regular expression ".*string$", say "ends with string.";
replace the regular expression "simple" in T with "replacement";