title: Using preg_replace/ preg_match with UTF-8 characters - specifically Māori macrons
body: <p>I'm writing some autosuggest functionality which suggests page names that relate to the terms entered in the search box on our website.</p>
  
  <p>For example typing in "rubbish" would suggest "Rubbish &amp; Recycling", "Rubbish Collection Centres" etc.</p>
  
  <p>I am running into a problem that some of our page names include macrons - specifically the macron used to correctly spell "Māori" (the indigenous people of New Zealand). </p>
  
  <p>Users are going to type "maori" into the search box and I want to be able to return pages such as "Māori History". </p>
  
  <p>The autosuggestion is sourced from a cached array built from all the pages and keywords. To try and locate Māori I've been trying various regex expressions like:</p>
  
  <pre><code>preg_match('/\m(.{1})ori/i',$page_title)
  </code></pre>
  
  <p>Which also returns page titles containing "Moorings" but not "Māori". How does preg_match/ preg_replace see characters like "ā" and how should I construct the regex to pick them up?</p>
  
  <p>Cheers
  Tama</p>