title: From within Java, how can I create a list of all possible numbers from a specific regular expression?
body: <p>I have a strange problem, at least one I've never come across. I have a precondition where customers have simple regular expressions associated with labels. The labels are all they care about. What I would like to do is create a list of all possible numbers that would match each of these regular expressions. I would have logic that would warn me when the list is beyond a certain threshold. </p>
  
  <p>Here is an example of the regular expression: <code>34.25.14.(227|228|229|230|243|244|245|246)</code></p>
  
  <p>Lets say that these ip(s) are associated with ACME. Behind the scenes when the user selects ACME (in our UI), I'm filling out a filter object that contains all of those possible numbers and submitting them as an OR query to a highly specialized Vertica database.</p>
  
  <p>I just can't determine an elegant way of creating a list of numbers from said regular expressions.</p>
  
  <p>The others aspect of this, is that the java code within another portion of the product is using those regular expressions to show ACME by using a java Pattern.compile(), which means the customer 'could' create a complex regular expression. I've only seen them, so far, use something simple as shown above.</p>
  
  <p>Is there a method that will generate a list based on regular expression?</p>
  
  <p>Thanks for your time.</p>