title: Capturing numbers with regex
body: <p>I have these strings that contain sets of digits. What I need to do is capture every set of digits and create new strings for them. For example, in the string: "60 32 28 Some Characters 0 0 0" I need to capture and place 60, 32, 28, 0, 0, 0 into separate strings. Here is some of the code I have already tried:</p>
  
  <pre><code>public class First {
  
  public static void main(String[] args) {
  
      String one = "60 32 28 Some Characters 0 0 0";
  
  
      Pattern a = Pattern.compile("[0-9]{2}.*?([0-9]{2}).*?([0-9]{2})");      
      Matcher b = a.matcher(one);
      b.find();
  
      String work = b.group();
      String work1 = b.group(1);
      String work2 = b.group(2);
  
      System.out.println("this is work: " + work);
      System.out.println("this is work1: " + work1);
      System.out.println("this is work2: " + work2);
  
      Pattern c = Pattern.compile("([0-9]{2})|([0-9])");      
      Matcher d = c.matcher(one);
      d.find();
  
      String work3 = d.group();
      System.out.println(work3);
  
  
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>However, I am unable to capture every digit. I have looked around other tutorials, but I am unable to find what I am doing wrong with my regex, or if there is another solution besides using regex. I have stayed away from using substrings because the text between digits usually vary in length. Any help would be appreciated.</p>