title: Java regular expression with hyphen
body: <p>I need to match and parse data in a file that looks like:</p>
  
  <pre><code>4801-1-21-652-1-282098
  4801-1-21-652-2-282098
  4801-1-21-652-3-282098
  4801-1-21-652-4-282098
  4801-1-21-652-5-282098
  </code></pre>
  
  <p>but the pattern I wrote below does not seem to work.  Can someone help me understand why?</p>
  
  <pre><code>final String patternStr = "(\\d+)-(\\d+)-(\\d+)-(\\d+)-(\\d+)-(\\d+)";
  final Pattern p = Pattern.compile(patternStr);
  
  while ((this.currentLine = this.reader.readLine()) != null) {
      final Matcher m = p.matcher(this.currentLine);
      if (m.matches()) {
          System.out.println("SUCCESS");
      }
  }
  </code></pre>