Allow regular expressions

Add ability to specify regular expressions for replacing
strings.