Fixed template issue with escaping single quotes, new lines etc. Regular expressions moved to variables in order to compile it only once.
Changelog entry.
Merge branch 't/11102'