title: Extract an ISBN with regex
body: <p>I have an extremely long string that I want to parse for a numeric value that occurs after the substring "ISBN". However, this grouping of 13 digits can be arranged differently via the "-" character. Examples: (these are all valid ISBNs) <code>123-456-789-123-4</code>, OR <code>1-2-3-4-5-67891234</code>, OR <code>12-34-56-78-91-23-4</code>. Essentially, I want to use a regex pattern matcher on the potential ISBN to see if there is a valid 13 digit ISBN. How do I 'ignore' the "-" character so I can just regex for a <code>\d{13}</code> pattern?  My function:</p>
  
  <pre><code>public String parseISBN (String sourceCode) {
    int location = sourceCode.indexOf("ISBN") + 5;
    String ISBN = sourceCode.substring(location); //substring after "ISBN" occurs
    int i = 0;
    while ( ISBN.charAt(i) != ' ' )
      i++;
    ISBN = ISBN.substring(0, i); //should contain potential ISBN value
    Pattern pattern = Pattern.compile("\\d{13}"); //this clearly will find 13 consecutive numbers, but I need it to ignore the "-" character
    Matcher matcher = pattern.matcher(ISBN); 
    if (matcher.find()) return ISBN;
    else return null;
  }
  </code></pre>