Many regular expression engines, my own package pat included, suffer from a tendency to produce stack overflows in some circumstances. This seems to be a widespread problem, common to many java regular expression engines. To overcome this limitation I recently wrote a new regular expression library, completely from scratch, designed to avoid this problem. It conforms (mostly) to the java.util.regex interface, so changing your code to use my package is as simple as changing your import statement.
Please try it out and let me know what you think. See the main site: http://stevenrbrandt.com.