The validation on the parameter seems incorrect. Both the ```PATTERN``` and ```REPLACEMENT``` should be required.