title: Group adjacent regex matches
body: <p>I am trying to build a regex that finds the number of syllables in a word with the following conditions:</p>
  <ul>
  <li>Vowels are counted as syllables.</li>
  <li>Two or more consecutive vowels are counted as one syllable</li>
  <li>Ignore 'e' if it is the last letter in a word (don't count it as a syllable)</li>
  <li>Vowels are: 'a', 'e', 'i', 'o', 'u', and 'y'.</li>
  </ul>
  <p>I came up with <code>[e][aeiou]*(?=[a-z])|[aiouy][aiouy]*(?=[a-z ])</code>, which you can test <a href="https://regex101.com/r/5UoxS7/1" rel="nofollow noreferrer">here</a>. As seen in the test, the word 'they' comes up as two separate matches (e and y are counted separately), which is an issue. How can this be solved?</p>
  <p><em>Also, if possible, it would be great if there is an explanation to regex solutions</em>.</p>