In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
What is the basic syntax of Java regular expressions? I believe many inexperienced people don't know what to do about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
What is a regular expression?
1. A regular expression is an expression that detects and matches strings.
2. Regular expressions are description rules, which are well supported by mainstream languages.
3. String checking, searching and replacing are the main usage scenarios of regular expressions.
Character range matching: the regular expression indicates the correct error A precisely matches the set of 2 characters allowed by a single character Aax/y, allowing the occurrence of any single character ZC [a-z] [Amurz] [0-9] character range a D 8A an A [^ XYZ] [^ 0-9] characters in the set are not allowed to appear 0 Ay 8 metacharacters:
Metacharacters refer to characters that only refer to a certain class of characters through some special expressions, called metacharacters.
The regular expression indicates that the correct error\ d matches any single number 8i\ D matches any single character i8\ w matches any single alphanumeric underscore Y &\ W matches any single character & Y\ s matches a single space
X\ nmatches a single newline character
x. Matches any single character (except newline characters) -\ r\ n\. Special characters, only match multiple times: regular expression indicates correct error A {3} accurate N times matching AAAAAA {3,} at least N times AAAAA\ d {3pm 5} the minimum number of occurrences and the maximum number of occurrences can be zero to infinite, equivalent to {0,} 1234 -\ d + at least once, equivalent to {1,} 12
\ d? It appears at most once, which is equivalent to the positioning matching of {0recoery 1} 112: regular expression indicates correct error ^ A.* head matching ABCCBA.*A$ tail matching CBA ABC ^ A. * A$ full word matching ACCCAACCCB after reading the above, have you mastered the basic syntax of Java regular expressions? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.