How should the regular expression match data similar to \ xf0 \ x9f \ x91 \ xab?

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.