Java regular expression

1. What is a Java regular expression

1. Regular expressions (regex) is a pattern used to describe a certain amount of text. It is often used for string matching, finding and replacing. 2. Regular expression is a sharp tool for string processing. It is an expression describing string patterns. The core value of a regular expression is to match a string.

3. Example:

2. Rules for regular expressions

2.1 common regular expressions

2.2 quantity representation

2.3 logical operators

3. Case reference

3.1 email: ^ \ W + ([- +.] \w+)*@\w+([-.] \w+)*\. \w+([-.] \W +) * $(standard) reference ^ \ W + @ \ W + \. \ w+$

3.2 China telephone number: ^ (\ (\ D {3} \) | \ D {3}-)? \D {8} (standard) reference ^ 0 [0-9] {2,3} - [1-9] [0-9] {6,7}$

3.3 verify whether the address of the internal Tomcat server meets the requirements

Author: little bit, source: http://www.cnblogs.com/leeSmall/p/7627327.html The copyright belongs to the author. Please indicate the source for reprint

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>