Although the code does a Regex.Replace, which should allow for the ReplacementText to specify a regex replacement (e.g., with group numbers or names), the verification code does not consider whether there were any matches but merely checks to see whether the resulting string contains the literal ReplacementText string. If it doesn't, it reports failure and does not save the file.