title: In PHP PCRE syntax, how does one specify a multi-codepoint Unicode character/"emoji"?
body: <p><strong>Code:</strong></p>
  <pre><code>var_dump(preg_replace('#\x{1F634}#u', '', 'This is the sleeping emoji: '));
  var_dump(preg_replace('#\x{1F1FB 1F1F3}#u', '', 'This is the Vietnam flag: '));
  </code></pre>
  <p><strong>Expected output:</strong></p>
  <pre><code>string(28) &quot;This is the sleeping emoji: &quot;
  string(33) &quot;This is the Vietnam flag: &quot;
  </code></pre>
  <p><strong>Actual output:</strong></p>
  <pre><code>string(28) &quot;This is the sleeping emoji: &quot;
  string(34) &quot;This is the Vietnam flag:   &quot;
  </code></pre>
  <p><strong>Analysis:</strong></p>
  <p>The one-codepoint emoji is successfully removed, but the multi-codepoint emoji is not detected.</p>
  <p><strong>Research performed:</strong></p>
  <p>Read the following on: <a href="https://www.php.net/manual/en/regexp.reference.escape.php" rel="nofollow noreferrer">https://www.php.net/manual/en/regexp.reference.escape.php</a></p>
  <blockquote>
  <p>After &quot;\x&quot;, up to two hexadecimal digits are read (letters can be in upper or lower case). In UTF-8 mode, &quot;\x{...}&quot; is allowed, where the contents of the braces is a string of hexadecimal digits. It is interpreted as a UTF-8 character whose code number is the given hexadecimal number. The original hexadecimal escape sequence, \xhh, matches a two-byte UTF-8 character if the value is greater than 127.</p>
  </blockquote>
  <p>Unfortunately, it does not mention multi-codepoint Unicode characters.</p>
  <p><strong>Question:</strong></p>
  <p>How to specify a multi-codepoint emoji/Unicode character in PHP PCRE syntax?</p>
  <p><strong>Helpful note:</strong></p>
  <p>It is not a <em>range</em>! I am able to detect and remove ranges. This is a <em>single</em> emoji/Unicode character consisting of <em>multiple</em> &quot;codepoints&quot;. There are quite a few of those specified here: <a href="https://www.unicode.org/Public/emoji/13.1/emoji-sequences.txt" rel="nofollow noreferrer">https://www.unicode.org/Public/emoji/13.1/emoji-sequences.txt</a></p>