title: How to iterate over regex expression
body: <p>Let's say I have the following String:</p>
  
  <pre><code>name1=gil;name2=orit;
  </code></pre>
  
  <p>I want to find all matches of <code>name=value</code> and make sure that the whole string matches the pattern.</p>
  
  <p>So I did the following:</p>
  
  <ol>
  <li><p>Ensure that the whole pattern matches what I want.</p>
  
  <pre><code>Pattern p = Pattern.compile("^((\\w+)=(\\w+);)*$");
  Matcher m = p.matcher(line);
  if (!m.matches()) {
      return false;
  }
  </code></pre></li>
  <li><p>Iterate over the pattern <code>name=value</code></p>
  
  <pre><code>Pattern p = Pattern.compile("(\\w+)=(\\w+);");
  Matcher m = p.matcher(line);
  while (m.find()) {
      map.put(m.group(1), m.group(2));
  }
  </code></pre></li>
  </ol>
  
  <p>Is there some way to do this with one regex?</p>