I am running a regex in a java function to parse a document and return true if it has found the string specified by the regex and return false if it hasn\'t. But the problem
I agree to check the regular expressions before they are used. If you need a safety net, you might use something like this...
http://gist.github.com/630969