Regex quirks and characters
This is very likely broken because untested; and I'm not sure how the templates escape values