title: Whole word matching with dot characters in MySQL
body: <p>In MySQL, when searching for a keyword in a text field where only "whole word match" is desired, one could use REGEXP and the [[:&lt;:]] and [[:>:]] word-boundary markers:</p>
  
  <pre><code>SELECT name FROM tbl_name WHERE name REGEXP "[[:&lt;:]]word[[:&gt;:]]"
  </code></pre>
  
  <p>For example, when we want to find all text fields containing "europe", using</p>
  
  <pre><code>SELECT name FROM tbl_name WHERE name REGEXP "[[:&lt;:]]europe[[:&gt;:]]"
  </code></pre>
  
  <p>would return "europe map", but not "european union".</p>
  
  <p>However, when the target matching words contains "dot characters", like "u.s.", how should I submit a proper query?  I tried the following queries but none of them look correct.</p>
  
  <p>1.</p>
  
  <pre><code>SELECT name FROM tbl_name WHERE name REGEXP "[[:&lt;:]]u.s.[[:&gt;:]]"
  </code></pre>
  
  <p>2.</p>
  
  <pre><code>SELECT name FROM tbl_name WHERE name REGEXP "[[:&lt;:]]u[.]s[.][[:&gt;:]]"
  </code></pre>
  
  <p>3.</p>
  
  <pre><code>SELECT name FROM tbl_name WHERE name REGEXP "[[:&lt;:]]u\.s\.[[:&gt;:]]"
  </code></pre>
  
  <p>When using double backslash to escape special characters, as suggested by d'alar'cop, it returns empty, even though there are something like "u.s. congress" in the table</p>
  
  <pre><code>SELECT name FROM tbl_name WHERE name REGEXP "[[:&lt;:]]u\\.s\\.[[:&gt;:]]"
  </code></pre>
  
  <p>Any suggestion is appreciated!</p>