title: Java RegEx: Replacing a phone number (including optional parentheses)
body: <p>Shouldn't this put the SPAN markers outside the phone number, not inside?</p>
  
  <pre><code>String aParagraph = "start 201-555-1212 more (301)-777-1212 again (401) 888-1212 end";
  String phoneRegEx = "\\b(\\(?[1-9]{1}[0-9]{2}\\)?[- ]?[1-9]{1}[0-9]{2}-[0-9]{4})\\b";
  String replaceWith = "&lt;span&gt;$1&lt;/span&gt;";
  
  aParagraph = aParagraph.replaceAll(phoneRegEx , replaceWith);
  </code></pre>