title: replace emoji unicode symbol using regexp in javascript
body: <p>As you all know <a href="http://apps.timwhitlock.info/emoji/tables/unicode#block-6b-missing-transport-and-map-symbols" rel="noreferrer">emoji</a> symbols are coded up to 3 or 4 bytes, so it may occupy 2 symbols in my string. For example 'wew'.length = 7
  I want to find those symbols in my text and replace them to the value that is dependent from its code. 
  Reading SO, I came up to XRegExp library with unicode plugin, but have not found the way how to make it work.</p>
  
  <pre><code>var str = 'wew';// \u1F601 symbol
  var reg = XRegExp('[\u1F601-\u1F64F]', 'g'); //  /[ὠ1-ὤF]/g -doesn't make a lot of sense  
  //var reg = XRegExp('[\uD83D\uDE01-\uD83D\uDE4F]', 'g'); //Range out of order in character class
  //var reg = XRegExp('\\p{L}', 'g'); //doesn't match my symbols
  console.log(XRegExp.replace(str, reg, function(match){
     return encodeURIComponent(match);// here I want to have smth like that %F0%9F%98%84 to be able to map anything I want to this value and replace to it
  }));
  </code></pre>
  
  <p><a href="http://jsfiddle.net/HFZk3/" rel="noreferrer">jsfiddle</a></p>
  
  <p>I really don't want to bruteforce the string looking for the sequence of characters from my range. Could someone help me to find the way to do that with regexp's.    </p>
  
  <p><strong><em>EDITED</em></strong>
  Just came up with an idea of enumerating all the emoji symbols. Better than brutforce but still looking for the better idea</p>
  
  <pre><code>var reg = XRegExp('\uD83D\uDE01|\uD83D\uDE4F|...','g');
  </code></pre>