In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail the special characters that need to be escaped in the rules. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
If you want to find a file with a * in the file name, you need to escape *, that is, add a\ to it. Ls\ * .txt. Regular expressions have the following special characters. Need to escape
Special character
Description
$
Matches the end of the input string. If the Multiline property of the RegExp object is set, $also matches'\ n'or'\ r'. To match the $character itself, use\ $.
(.)
Marks the start and end positions of a subexpression. Subexpressions can be obtained for later use. To match these characters, use\ (and\).
*
Matches the previous subexpression zero or more times. To match the * character, use\ *.
+
Matches the previous subexpression one or more times. To match the + character, use\ +.
.
Matches any single character except the newline character\ n. To match., use\.
[]
Marks the beginning of a bracketed expression. To match [, use\ [.
?
Matches the previous subexpression zero or once, or indicates a non-greedy qualifier. To play Standard PvP match? Characters, please use\?
\
Marks the next character as either a special character, a literal character, a backward reference, or an octal escape character. For example,'n' matches the character'n'. \ n' matches the newline character. The sequence'\ 'matches "\", while'\ ('matches "(".
^
Matches the start position of the input string unless used in a square bracket expression, which indicates that the character collection is not accepted. To match the ^ character itself, use\ ^.
{}
Marks the beginning of the qualifier expression. To match {, use\ {.
| |
Indicates a choice between the two. To match |, use\ |.
So it is.
*. ? + $^ [] () {} |\ /
You construct regular expressions in the same way as you create mathematical expressions. That is, a variety of metacharacters and operators are used to combine small expressions to create larger expressions. The components of a regular expression can be a single character, a character collection, a character range, a choice between characters, or any combination of all these components.
This is the end of the article on "what special characters need to be escaped in the rule". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.