add regex function to formatter