title: Java Regex Help on \p{Punct}
body: <p>I have the following regexes, one with <code>\p{Punct}</code> and the other one without</p>
  
  <p>Snippet (1):</p>
  
  <pre><code>add(\s[\w\p{Punct}]+)+(\s#\w+)*
  </code></pre>
  
  <p>Snippet (2):</p>
  
  <pre><code>add(\s[\w]+)+(\s#\w+)*
  </code></pre>
  
  <p>If I input "add buy an egg #grocery testing", it will result matching in (1) but not matching in (2). Any idea what is happening?</p>