Added tests for templates with regex-significant characters in their delimiters
(cherry picked from commit 625adb81a33a4333d24c442fe818d029cd319cf6)