title: Find global pattern matches
body: <p>I have a pattern like this:</p>
  
  <pre><code>String pattern = "(media:\\s\\d+)"
  </code></pre>
  
  <p>I want to match a substring variation of </p>
  
  <pre><code>"media:" + space/no space + X
  </code></pre>
  
  <p>...where <strong>X</strong> is a set of numbers. The pattern can appear anywhere in text and followed by anything. </p>
  
  <p>Here's the example:</p>
  
  <blockquote>
    <p>"The Moment of Impact text: Camera captures the deadly explosions and
    chaos near the marathon's finish line.<strong>media: 18962980</strong> Video shows
    runner ... falling as a result of the blast <strong>media: 18967421</strong>A bystander
    films the chaos of people positioned in between the two explosions."</p>
  </blockquote>
  
  <p>For this my pattern returns only the first occurrence instead of all. 
  Here is the code I'm using:</p>
  
  <pre><code>String pattern = "(media:\\s\\d+)"; 
  Pattern media = Pattern.compile(pattern,Pattern.MULTILINE);
  java.util.regex.Matcher m = media.matcher(text);        
  if(m.find()) {
      logger.info("-- group:"+m.group());     
  }
  </code></pre>