In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article is about the regular expressions commonly used to share with you, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article. Let's take a look at it.
What is a regular expression?
A regular expression is a search pattern formed by a sequence of characters.
When you search for data in text, you can use search patterns to describe what you want to query.
A regular expression can be a simple character or a more complex pattern.
Regular expressions can be used for all text search and text replacement operations.
This article introduces some common regular expressions (money, non-negative integers, positive integers, mailboxes, mobile phone numbers). The details are as follows:
Character
[amurz] stands for the letter amurz
[^ amurz] the representative is not in aMuz.
[0-9] stands for 0-9
[^ 0-9] means not in 0-9.
\ d is equivalent to [0-9]
\ d is equivalent to [^ 0-9]
Qualifying character
* represents the previous subexpression 0 or more times
+ represents one or more times
? For 0 or 1 time
{n} represents n times
{n,} represents n to infinite times
{nmenthm} represents n to m times.
Common expression
Money: / (^ [1-9] ([0-9] +)? (\. [0-9] {1jue 2})? $) | (^ (0) {1} $) | (^ [0-9]\. [0-9] ([0-9])? $) /
Money is reserved for two decimal places, and the first letter cannot be 0. Unless it's a little past zero or zero. The above is divided into three parts. A decimal at the beginning of 1-9, a decimal at the beginning of 0-9
Email: / ^ [a-zA-Z0-9 zA-Z0. -] + @ [a-zA-Z0-9 -] + (\. [a-zA-Z0-9 -] +) *. [a-zA-Z0-9] {2jue 6} $/
Matching format XXX@qq.com XXX@XX.com.cn
Positive integer: / ^ [1-9] [0-9] * $/
Integer: / ^ [0-9] * $/
Mobile phone number: / ^ 1 [0-9] {10} $/ matching format is 11 digits starting with 1. Because it doesn't have to be an exact match all the time, it's all 11 digits at the beginning of 1.
The above are the commonly used regular expressions, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow 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.