Fix an issue with the regex used to replace already inlined templates