Added a 'flags' option to the @{replace} helper.