Modifications to RegEx for both templates