Adds text replacing functionality via regex.