In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you "what are the introduction knowledge points of regular expressions". The content is simple and easy to understand, and the organization is clear. I hope it can help you solve your doubts. Let Xiaobian lead you to study and learn this article "what are the introduction knowledge points of regular expressions".
1. What is a regular expression?
Basically, a regular expression is a pattern used to describe a certain amount of text. Regex stands for Regular Express. This article will be used to represent a specific regular expression. A paragraph of text is the most basic pattern, simply matching the same text.
2. Regular Expressions: A Guide to Regular Expressions
A regular expression engine is software that processes regular expressions. Typically, the engine is part of a larger application. In the software world, different regular expressions are not compatible with each other. This tutorial focuses on Perl 5 type engines because they are the most widely used. We will also mention some of the differences from other engines. Many modern engines are similar, but not identical. For example. NET regular library, JDK regular package.
3. Regular Expressions: A Guide to Regular Expressions
The most basic regular expression consists of a single literal symbol. For example, it will match the *** occurrence of the character "a" in the string. For example, for the string "Jack is a boy". The "a" after the "J" will be matched. The second "a" will not be matched.
Regular expressions can also match the second "a," which must be where you tell the regular expression engine to start searching from *** matches. In the text editor, you can use Find Next. In programming languages, there is a function that lets you search backwards from the last match.
Similarly, it matches "cat" in "About cats and dogs." That's telling the regular expression engine, find one, follow one, follow another.
Note that the regular expression engine is case sensitive by default. "Cat" will not match unless you tell the engine to ignore case.
◆ Special characters
For text characters, 11 characters are reserved for special purposes. They are:
[ ] \ ^ $ . | ? * + ( )
These special characters are also called metacharacters.
If you want to use these characters as text characters in a regular expression, you need to escape them with a backslash "\". For example, if you want to match "1+1=2," the correct expression is.
Note that this is also a valid regular expression. But instead of matching "1+1=2," it matches "111=2" in "123+111=234." Because "+" here means special meaning (repeated one to many times).
In programming languages, note that some special characters are processed by the compiler before being passed to the regular engine. So regular expressions in C++ are written as "1\\+1=2." To match "C:\temp," you use regular expressions. In C++, the regular expression becomes "C:\\\temp."
◆ Undisplayable characters
Special character sequences can be used to represent certain non-displayable characters:
Representative Tab(0x09)
Represents carriage return (0x0 D)
Represents newline (0x0A)
Note that text files in Windows use "\r\n" to end a line while Unix uses "\n."
The above is "regular expression entry knowledge points what" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!
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.