title: Regular Expression for x vowels in word of n length
body: <p>I'm trying to write a regular expression in Java that will match a word of n length that has a at least x number of vowels in it.</p>
  
  <p>So far I've come up with the following:</p>
  
  <pre><code>// match words that are length 10 and have at least 2 vowels in them
  (?=\w{10})(?:[^aeiou\W]*[aeiuo]){2}\w+
  </code></pre>
  
  <p>This seems to work but also matches words greater than length 10, i.e.:</p>
  
  <p>wildernesses - matches</p>
  
  <p>volatilizations - matches</p>
  
  <p>voiceprint - matches (this should be the only match)</p>
  
  <p>I would like it so that the length=10 constraint is enforced.  I suspect that it may have something to do with the fact that I'm adding letters (the vowels) to the length of the string, but I'm not certain.  Any help / guidance will be appreciated.</p>