C Regular expression 120

Updated on technology 2024-04-19
8 answers
  1. Anonymous users2024-02-08

    ab\w[xyui]c

    ab is constant.

    w is limited to letters or numbers.

    xyui] means to take one of x, y, u, i.

    c is also constant.

  2. Anonymous users2024-02-07

    There's a lot of it in this book. Just go buy a book.

  3. Anonymous users2024-02-06

    In my understanding, regular expressions:

    [\u4e00-\u9fa5]$ "

    It is not possible to match any strings.

    Because: [u4e00- u9fa5]$

    in your $, which has been matched to the end of the string.

    As a result, you add a space to match:

    The end of the string is followed by a space.

    itself does not exist.

    Because even if a string ends with a Chinese character plus a space, then the position at the end corresponds to $, and it can no longer match the space.

    Therefore, such a regular rule is logically unworkable.

    If you are interested, you can take a look at my summary:

    Crifan regular expression learning experience.

    You can't post an address here, please search for the title with Google to find the address of the post).

  4. Anonymous users2024-02-05

    That's right, it's dispensable.

    Because the ID number of the first generation is fifteen, and the second generation is eighteen, although there are not many of the first generation, there are still a few people who are using it.

    In addition, if you look at the whole regularity, if these three numbers are not dispensable, why do you have to divide them, directly add them up in the first 14, for: d w$ Isn't it better?

    In addition, there is a w at the back, which means that it can be letters, numbers and underscores, but this is a bit inaccurate, because some ID numbers are directly followed by a question mark, W does not support question marks, and there may be problems when encountering such an ID number, so it should be changed to the following appearance to be more compatible:

    d(\d)?[w\?]

  5. Anonymous users2024-02-04

    There is a problem with this regular, it should be d( d)?w$ This can mean that the 3 digits can be without, and then the 15-digit ID card can be matched.

    In fact, this is too simple.,Finally, you have to write a or something that can pass.,Commonly used ID card verification, for example.。

    ^\d$|^d$|^d(\d|x|x)) $ means that all three of the following can be:

    15 digits.

    18 digits.

    17 digits + x

  6. Anonymous users2024-02-03

    ?- Match the preceding subexpression zero times or once, or indicate a non-greedy qualifier.

    d?This will support 15-digit ID cards.

  7. Anonymous users2024-02-02

    It's the dispensable meaning of the D paragraph in the back.

  8. Anonymous users2024-02-01

    First of all, you need to understand that the regular code is in the form of a string in the text, and some characters of the string need to be escaped, for exampleAnd, of course, regex also need to be escaped (double escape), for example\w

    Browser console input.

    For example, the specific content of this regular is:$ to insert text (([w -

    The specific match is:

    Matchthis symbol.

    Insert textNormal full matchingInsert textThese four Chinese characters.

    Match the Chinese opening parentheses

    ([\w\-\In parentheses, there is a grouping, which will be discussed below.

    Match the Chinese closing parentheses

    Still match oneSymbol.

    For the list 4 grouping.

    The parentheses are only grouped and do not participate in any matching, and the parentheses are assigned to group 1 (i.e., in the replacement text

    Represents a range of single matches, and the circled regulars correspond to the range of single-match characters.

    RepresentationThe circled range may match 0-n times (Match 0-1 timesMatch 1-n times).

    \wIndicates that English characters and numbers are matched.

    indicates that the minus sign is matched

    Indicates a match Indicates a match

    Indicates a match ( Normal parentheses have the meaning of grouping, so they need to be escaped.

    indicates a match) then the meaning is obvious, match "$ to insert the text (abc-+ and replace group 1 with the text below.

    Directly on the chestnuts.

    Demonstration example of the Liuyuan Relator.

    The red mark is the content that is grouped in the text, and the yellow marker marks the grouped Hail Tomb in the replaced text.

    The blue marks are the contents of the grouping that has been replaced.

Related questions
7 answers2024-04-19

Hello, although I haven't studied PHP, but in order to help you (and your 100 points) also take a little look, here are my opinions. Please forgive me if it is not right. >>>More

7 answers2024-04-19

It's not equal, and there doesn't seem to be such a thing as twice as much as AS. >>>More

7 answers2024-04-19

string s = "Beijing Tiananmen Square to the Great Hall of the People to the east, at the second intersection to the east"; >>>More

2 answers2024-04-19

/our-price\">\u00a5 (./span>/'

unnnn means "the character in unicode with hexadecimal nnn". >>>More

24 answers2024-04-19

Operate from right to left, -i--so calculate -i first--, the operation level is higher, so it can be written as -(i--)i--for 8, add a - sign, so -i--is 8, at this time i--after, i=7, and then -i++ is the same, can be written as -(i++) so -i++ is -7, at this time i++ becomes 8,--i, subtract 1 before execution, so --i is 7, at this time i=7, ++i is the same, add 1 before executing i, so ++i is 8, at this time i=8, then calculate i--,i--is still equal to 8, then i minus one becomes 7, i++, i++ is equal to 7, and then i++, i=8, so finally i=8, and then print it out in turn, pay attention to the operation is from right to left, but print from left to right print i,i++,i--,i,--i,-i++,i-, so the check mark result is out.