title: merge two regular expressions
body: <p>I have two regular expressions, one pulling out usernames from a csv string, and the other pulling out emails.</p>
  
  <p>the string format is like this:</p>
  
  <pre><code>String s = "name lastname (username) &lt;mail@mail.something.dk&gt;; name lastname (username) &lt;mail@mail.something.dk&gt;; name lastname (username) &lt;mail@mail.something.dk&gt;";
  </code></pre>
  
  <p>the code for my regular expressions are like this.</p>
  
  <pre><code>Pattern pattern = Pattern.compile("(?&lt;=\\()[^\\)]+");
  Matcher matcher = pattern.matcher(s);
  Pattern pattern2 = Pattern.compile("((?&lt;=&lt;)[^&gt;]+)");
  Matcher matcher2 = pattern2.matcher(s);
  
  while (matcher.find() &amp;&amp; matcher2.find()) {
      System.out.println(matcher.group() + " " + matcher2.group());
  }
  </code></pre>
  
  <p>I've found several qeustions about merging regexes, but from the answers i haven't been able to figure out how to merge mine.</p>
  
  <p>my printouts show:</p>
  
  <pre><code>"username mail@mail.com"
  </code></pre>
  
  <p>would I be able to <strong>print out the same</strong> from a <strong>single matcher</strong>, using one regex?</p>
  
  <p>obs: this is a school assignment, which means i do not "need" to merge them or do any more, but i'd like to know if it is possible, and how difficult it would be.</p>