In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces you what are the rules for the use of regular expressions, the content is very detailed, interested friends can refer to, I hope it can be helpful to you.
Regular expression
Regular expression, also known as regular expression. (English: Regular Expression, often abbreviated as regex, regexp or RE in code), a concept in computer science. Regular expressions are often used to retrieve and replace text that conforms to a certain pattern (rule).
Many programming languages support string manipulation using regular expressions. For example, a powerful regular expression engine is built into Perl. The concept of regular expressions was first popularized by tools in Unix, such as sed and grep. Regular expressions are usually abbreviated to "regex". The singular has regexp and regex, and the plural has regexps, regexes, and regexen.
Here are the rules for using regular expressions. The details are as follows:
\ d | match any number in 0-9, which is equivalent to [0-9]
\ d | match non-numeric characters, equivalent to [^ 0-9]
\ w | match any letter, number or underscore, which is equivalent to [^ A-Za-z0-9 _]
\ W | matches any non-alphanumeric or underscore character, which is equivalent to [^ A-Za-z0-9 _]
\ s | matches any white space characters, including spaces, tabs, page breaks, which is equivalent to? [\ f\ n\ r\ t\ v]
\ s | matches any non-white space character, which is equivalent to [^\ f\ n\ r\ t\ v]
\ n | match newline character
\ r | match a carriage return character
\ t | match the configuration table character
\ v | match vertical tabs
\ f | match the feed character
These characters have special meanings in regular expressions, such as *, +,? ,\
\ | escape character and mark the next character as a special character
| ^ | matches the position where the string begins |
| $| matches the position at the end of the string |
| * | match the previous character or subexpression zero or more times |
| + | matches the previous character or subexpression one or more times |
? | match the previous character or subexpression zero or once
. | | "Dot" matches any single character except "\ r\ n" |
| | or |
[] | character collection
() | grouping. To match parenthesis characters, use "("? Or ")"
Qualifying characters, also known as quantifiers, are used to indicate the number of characters that match.
| * | match the previous character or subexpression zero or more times |
| + | matches the previous character or subexpression one or more times |
? | match the previous character or subexpression zero or once
{n} | n is a non-negative integer, matching determined n times
{n,} | n is a non-negative integer, matching at least n times
{n ~ (m)} | n and m are non-negative integers, where n
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.