title: Regex Expression Mixed Fraction
body: <pre><code>public class MixedNumberRegex {
  
      public static void main(String[] args) {
  
          Pattern FRACTION_PATTERN = Pattern.compile("(?:(\\d+)\\s+)?(\\d+)/(\\d+)");
  
          Matcher m = FRACTION_PATTERN.matcher("1/2 + 1 1/2");
  
          System.out.print(m.group(1));
      }
  }
  </code></pre>
  
  <p>Hi, I am trying to extract out the mixed number from the string. Is my pattern expression correct?
  From the example, I want the output to be "1 1/2".</p>
  
  <p>I keep getting the exception</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.IllegalStateException: No match found
        at java.util.regex.Matcher.group(Unknown Source)
        at MixedNumberRegex.main(MixedNumberRegex.java:15)
    `</p>
  </blockquote>