title: Regex not matching against ampersand
body: <p>I'm trying to match the following regex:</p>
  <pre><code>\b(?:mr|mrs|ms|miss|messrs|mmes|dr|prof|rev|sr|jr|&amp;|and)\.?\b
  </code></pre>
  <p>In other words, a word boundary followed by any of the strings above (optionally followed by a period character) followed by a word boundary.</p>
  <p>I'm trying to match this in Java, but the ampersand will not match. For example:</p>
  <pre><code>Pattern p = Pattern.compile(
          &quot;\\b(?:mr|mrs|ms|miss|messrs|mmes|dr|prof|rev|sr|jr|&amp;|and)\\.?\\b&quot;, 
          Pattern.CASE_INSENSITIVE);
      
  String result = p.matcher(&quot;mr one and mrs.two and three &amp; four&quot;).replaceAll(&quot; &quot;);
      
  System.out.println(&quot;[&quot;+result+&quot;]&quot;);
  </code></pre>
  <p>The output of this is: <code>[  one    two   three &amp; four]</code></p>
  <p>I've also tried this at regex101, and again the ampersand does not match: <a href="https://regex101.com/r/klkmwl/1" rel="nofollow noreferrer">https://regex101.com/r/klkmwl/1</a></p>
  <p>Escaping the ampersand does not make a difference, and I've tried using the hex escape sequence <code>\x26</code> instead of ampersand (as suggested in <a href="https://stackoverflow.com/questions/30534822/regex-not-matching-when-input-string-contains-an-ampersand">this question</a>). Why is this not matching?</p>