What does the x7f-xff in this regular mean?

Source: Internet
Author: User
See a source code written in the regular
/\<\{\s*\$[a-za-z_ \x7f-xff][a-za-z0-9_ \x7f-\xff]\s*\}\>/i

What do you mean by \x7f-xff in the office?


Reply to discussion (solution)

\x7f-\xff represents ASCII characters from 127 to 255, where \ is escaped.

Why do you want to value this range from 127 to 255? I'm sorry, I'll ask you a little bit further.

echo Bin2Hex (' why '); Get CEAACAB2C3B4

echo "\xce\xaa\xca\xb2\xc3\xb4"; to why


Why do you want to value this range from 127 to 255? I'm sorry, I'll ask you a little bit further.

It could be an IP address category.
A: the first is 0;1.0.0.0~126.0.0.0; host number 24 bit
B: The first two bits are 10;128.1.0.0~191.255.0.0; host number 16 bit
C: The first three bits are 110;192.0.1.0~223.255.255.0; Host number 8 bit
D: The first four bits are 1110;224.0.0.0~239.255.255.255
E: The first four bits are 1111;240.0.0.0~255.255.255.254

!!! This and IP have what relationship!!!

In brackets, in addition to the brackets themselves or the range of connectors, other cases are not metacharacters. So [\x7f-xff] represents the character groups of \, X, 7, F-x, F, F.

Sorry, yesterday's reply is wrong, correct, the meta-character "\XN" is used to match N, where n is the hexadecimal escape value, which must be a determined two digits long. For example, "\x41" matches "A" and "\x411" is equivalent to "A1". The connector "-" represents a range (if not the beginning) within a character group (a string within the brackets). It is important to note that the provisions on metacharacters are different within and outside the character group.

  • 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.