title: Regex Javascript Match string by first two characters
body: <p>I have to match a string by it's first two letters using Regex to check a specific two characters available as the first two letters of a string. 
  Here assume that the first two characters are 'XX'.</p>
  
  <p>And the strings I need to match are</p>
  
  <ul>
  <li>ABCDS </li>
  <li>XXDER </li>
  <li>DERHJ </li>
  <li>XXUIO</li>
  </ul>
  
  <p>So I need to filter this list to get strings that only starts with 'XX'</p>
  
  <p>code I tried so far</p>
  
  <pre><code>var filteredArr = [];
  var arr = [ "ABCDS ", "XXDER ", "DERHJ ", "XXUIO" ];
  var re = new RegExp('^[a-zA-Z]{2}');
  jQuery.each( arr, function( i, val ) {
  
  if(re.test(val )){
    filteredArr.push(val);
  }
  });
  </code></pre>
  
  <p>What will be the exact Regex pattern to check the string that starts with 'XX'</p>