title: mysql: find cyrillic or greek text in database
body: <p>I have a UTF8 table in MySQL containing names, with all types of text (numeric, capitals, greek, cycrillic etc).</p>
  
  <pre><code>---------------
  ID   Name
  ---------------
  001  Jane Smith
  002  John Doe
  003  Джемз Смис
  004  Пэтра Смис
  005  "Groove" Holme
  006  99er Dude
  </code></pre>
  
  <p>How can I select only the cyrillic names? (records 003 and 004)</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Thanks for the answer below, which looked like it would be correct, but didn't work. More research turned up this in the documentation:</p>
  
  <blockquote>
    <p>Warning</p>
    
    <p>The REGEXP and RLIKE operators work in byte-wise fashion, so they are
    not multi-byte safe and may produce unexpected results with multi-byte
    character sets. In addition, these operators compare characters by
    their byte values and accented characters may not compare as equal
    even if a given collation treats them as equal.</p>
  </blockquote>
  
  <p><strong>EDIT EDIT, A SOLUTION</strong></p>
  
  <p>I solved this by adding an extra field to my database which stores the script type, eg Cyrillic, Thai etc. Then a ran a batch process in PHP that detects the script and stores the information in the database.</p>
  
  <p>To detect the script in PHP, use Unicode regex functions. See this page:</p>
  
  <p><a href="http://www.regular-expressions.info/unicode.html" rel="nofollow">http://www.regular-expressions.info/unicode.html</a></p>