Validation on the replacement pattern of rewrite rules

Mantis: 0003197