How should the regular expression match data similar to \ xf0 \ x9f \ x91 \ xab? How should I match the regular expression \ xf0 \ x9f \ x91 \ xab. Please help! How to write an expression ?? How should the regular expression match data similar to \ xf0 \ x9f \ x91 \ xab?
How should I match the regular expression \ xf0 \ x9f \ x91 \ xab. Please help! How to write an expression ?? Share:
------ Solution --------------------
If your string is UTF-8, I guess it is correct. \ xf0 \ x9f \ x98 \ x83 and so on are separators. the entire string should have only several forms, each of them should be considered as a single character (no word, only occupying space, separator)
If your string comes from an API, you 'd better check the API documentation.
------ Solution --------------------
I have already said this in your other post. Unfortunately, your understanding is too bad.
Rule string: // \ xf0.0 .../
$ S = "this is only the test text \ xf0 \ x9f \ x98 \ x83 in the program. In fact, the emoticons are represented by the internal code \ xf0 \ x9f \ x86 \ x93. ";
Preg_match_all ('/\ xf0.../', $ s, $ r );
Foreach ($ r [0] as $ v) echo current (unpack ('H * ', $ v), PHP_EOL;
F09f9883
F09f8693