Added a new key replacement mode named "key-regex", which first replaces %key% from <var> with the key value, and then uses uses a regular expression for replacing by passing substring references.