title: How to extract a substring from string using regex
body: <p>code
  I want regex for this format and filter out 123456 if match the current format</p>
  
  <pre><code>PO # 123456
  PO# 123456
  PO #123456
  P.O. # 123456
  P.O.# 123456
  P.O. #123456
  </code></pre>
  
  <p>We have to filter substring from string notes__c field. my regex is only working for <code>PO #123456</code> and  <code>P.O. #123456</code></p>
  
  <pre><code>    Matcher rm = r.matcher(oOrder.Notes__c);
      Pattern r = Pattern.compile('PO #(\\S+)\\s');
      if(rm.find()) {
      string res2 =  rm.group(1);
      oOrder.test__c = res2;
      }
  </code></pre>