I would strongly recommend deploying such a regular expression matcher to avoid problems like this.
There are examples in the above article that you can use to test anything in your production deployment that accepts regular expressions to see how well it copes.