public class Regex extends Object
author: Wuwenbin
date: 2016年8月31日
time: 下午2:15:39
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
REG_ALNUM
Alphanumeric characters
|
static String |
REG_ALPHA
Alphabetic characters
|
static String |
REG_ASCII
ASCII characters
|
static String |
REG_BLANK
Space and tab
|
static String |
REG_CNTRL
Control characters
|
static String |
REG_DIGITS
Digits
|
static String |
REG_EMAIL
Email
|
static String |
REG_FIXED_TELEPHONE
国内固定电话
|
static String |
REG_GRAPH
SVisible characters (i.e. anything except spaces, control characters,
etc.)
|
static String |
REG_HTML
HTML
|
static String |
REG_IDENTIFICATION_CARD
身份证编码
|
static String |
REG_IP
i地址
|
static String |
REG_LEGAL_ACCOUNT
合法的名字(字母开头,允许5-16字节,允许字母数字下划线)
|
static String |
REG_LOWER
Lowercase letters
|
static String |
REG_MOBILE_TELEPHONE
移动电话
|
static String |
REG_POSTALCODE
邮政编码
|
static String |
REG_PRINT
Visible characters and spaces (i.e. anything except control characters,
etc.)
|
static String |
REG_PUNCT
Punctuation and symbols.
|
static String |
REG_SPACE
All whitespace characters, including line breaks
|
static String |
REG_SPACE_LINE
空白行
|
static String |
REG_SPACE_POINT
首尾空白字符
|
static String |
REG_UPPER
Uppercase letters
|
static String |
REG_URL
URL地址
|
static String |
REG_XDIGIT
Hexadecimal digits
|
| 构造器和说明 |
|---|
Regex() |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
countSubStrReg(String str,
String reg)
获取符合reg正则表达式的字符串在String中出现的次数
|
boolean |
isABC(String src)
判断是否纯字母组合
|
boolean |
isEmail(String email)
判断是否是符合邮箱
|
boolean |
isFloatNumeric(String src)
判断是否浮点数字表示
|
boolean |
isMatch(String str,
String reg)
判断字符串str是否符合正则表达式reg
|
boolean |
isNumeric(String src)
判断是否数字表示
|
public static final String REG_GRAPH
public static final String REG_PRINT
public static final String REG_SPACE
public static final String REG_LEGAL_ACCOUNT
public boolean isNumeric(String src)
src - 源字符串public boolean isABC(String src)
src - 源字符串public boolean isFloatNumeric(String src)
src - 源字符串public boolean isMatch(String str, String reg)
str - 需要处理的字符串reg - 正则public int countSubStrReg(String str, String reg)
str - 需要处理的字符串reg - 正则public boolean isEmail(String email)
email - 判断的字符串Copyright © 2017. All rights reserved.