Some other special symbols that represent abstract meanings

Source: Internet
Author: User

Some symbols represent the special meaning of abstraction in an expression:

Example 1:

When the expression "^aaa" matches "xxx aaa xxx", the result of the match is: failure. Because "^" requires matching with the beginning of the string, the "^aaa" can be matched only when "AAA" is at the beginning of the string, for example: "AAA xxx xxx".

Example 2:

When the expression "aaa$" matches "xxx aaa xxx", the result of the match is: failure. Because "$" requires a match to the end of the string, "aaa$" can be matched only when "AAA" is at the end of the string, for example: "xxx xxx aaa".

Example 3:

Expression "./b." When matching the "@@ ZZFCTHOTFIXZ", the result of the match is: "@a", the match to the position is: start at 2, end at 4.

Further clarification:

"/b" is similar to "^" and "$", but it does not match any characters, but it requires that it be in the left and right sides of the position in the match result, one side is the "/w" range and the other side is the range of "/w".

Example 4:

When the expression "/bend/b" matches "weekend,endfor,end", the result of the match is: "End", matching to the position: starting at 15, ending at 18.

Some symbols can affect the relationship between sub-expressions within an expression:

Example 5:

Expression "tom| When Jack "matches the string" I ' m Tom, he is Jack, the match is: success; the match is: "Tom"; the matching position is: start at 4, end at 7. When the next match is matched, the result is: "Jack", the match to the position: starting at 15, ending at 19.

Example 6:

Expression "(go/s*) +" when matching "Let's Go Go go!", the matching result is: success; match to the content is: "Go Go Go"; The matching position is: start at 6, end at 14.

Example 7:

Expression "¥ (/d+/.? /d*) "When matching" $10.9,¥20.5 ", the result of the match is: success; match to:" ¥20.5 "; match to position: start at 6, end at 10. The separately obtained parenthesis range matches to the content: "20.5".

Some other special symbols that represent abstract meanings

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.