title: Replace unicode matches in javascript
body: <p>I would like to replace the matched words/characters found in a search, for example if I search for <code>a</code> and I get the result <code>ádám</code>, I would like to highlight the <code>á</code>'s. Something like:</p>
  
  <pre><code>"ádám".replace(/(a)/gi, '*') // -&gt; should return "*d*m"
  </code></pre>
  
  <p>But of course this doesn't works. I'm trying out <a href="https://github.com/slevithan/xregexp" rel="nofollow">XRegExp</a> however I just can't figure it out.</p>
  
  <p>How would you do it for all languages? Is it possible?</p>