title: preg_replace doesn't accept unicode
body: <p>I'm trying to maintain only valid characters and Hebrew Unicode characters from a string using <code>preg_replace</code>.</p>
  
  <p>I'm getting an error on this string:</p>
  
  <pre><code>$PLAINText1 = preg_replace('/[^(\x20-\x7F),(\x05D0-\x05F2)]*/','', $PLAINText);
  </code></pre>
  
  <p>The error is:</p>
  
  <blockquote>
    <p>Compilation failed: range out of order in character class at offset 25 in....</p>
  </blockquote>
  
  <p>I already know the error is in this phrase only: <code>(\x05D0-\x05F2)</code></p>
  
  <p>I read many post about this issue here and didn't find a solution. One relevant post suggested adding } to the Unicode, so on this string:</p>
  
  <pre><code>$PLAINText1 = preg_replace('/[^(\x20-\x7F),(\x{05D0}-\x{05F2})]*/','', $PLAINText);
  </code></pre>
  
  <p>I'm getting the a different error:</p>
  
  <blockquote>
    <p>character value in <code>\x{...}</code> sequence is too large at offset 22 ...</p>
  </blockquote>
  
  <p>Please help.</p>