I came across the Perl module Regexp::Assemble which takes an arbitrary number of regular expressions and assembles them into a single regular expression that matches all that the individual ones.
Is there any similar library for Java? It will be quite tedious to write a combined regex for each and every input.
regexp might help you… The link points to an example that does similar to what you want, I am not sure if it will work with Regex dictionary or not though. Also, you might want to email the author and I am sure he can help you figure out a solution for your exact use case.