title: javascript replacing multiple characters
body: <p>I've searched n revised JS for replacing alphabetical letters(characters) with new ones, but I also want to replace multiple characters with different ones. </p>
  
  <p>i. e. words combined with 'w' letter(like gw, kw) SHOULD NOT be printed as Ñ± but ¼£. But code below isn't working properly :(</p>
  
  <p>Any ideas are appreciated.</p>
  
  <pre><code>$(function() {
  $("textarea").keyup(function() {
      var word = $(this).val();
      var tifinaghized = word.replace(/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]|gw|kw/g, function(s) {
          return alphabet[s];
      });
      $("div").text(tifinaghized);
  });
  });
  
  var alphabet = {
  'a': 'Æ',
  'b': 'ⴱ',
  'c': 'Î',
  'd': 'Ë',
  'e': 'Ã',
  'f': 'â',
  'g': 'Ñ',
  ...
  'w': '±',
  ...
  'gw': '¼£', 
  'kw': 'Ã¾'
  };
  </code></pre>