Php regular expression

Source: Internet
Author: User
Php uses regular expressions to match Chinese characters {code...}. because I do not know much about regular expressions, I would like to ask if the regular expressions will cause encoding problems when matching Chinese characters? Php matches Chinese characters with regular expressions

1. Can I use. + to match more than one Chinese character? 2. Will there be any problem if you use this '/Hi, haha/' to match Chinese characters?

Because I do not know much about the regular expression, I would like to ask if the regular expression is encoded when matching Chinese characters?

Reply content:

Php matches Chinese characters with regular expressions

1. Can I use. + to match more than one Chinese character? 2. Will there be any problem if you use this '/Hi, haha/' to match Chinese characters?

Because I do not know much about the regular expression, I would like to ask if the regular expression is encoded when matching Chinese characters?

  1. Yes

  2. Use/Hello, haha/. it can only match/hello. haha/this... because the two front and back slashes will be treated as common content ..

There are also some Chinese encoding problems, as if I am in Python, the normal str type content, with unicode characters to match Chinese, will not match, the content cache unicode encoding will be good

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.