Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-cr20g
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
dsk-cr20g
Commits
85e06948
Commit
85e06948
authored
May 24, 2023
by
caixingbing
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://192.168.60.201/root/dsk-operate-sys
parents
0c3786e2
76b9970f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
CheckUtils.java
...common/src/main/java/com/dsk/common/utils/CheckUtils.java
+44
-0
No files found.
dsk-common/src/main/java/com/dsk/common/utils/CheckUtils.java
0 → 100644
View file @
85e06948
package
com
.
dsk
.
common
.
utils
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
/**
* 邮箱和手机号验证
*/
public
class
CheckUtils
{
public
static
final
String
REG_Moblie
=
"^((13[0-9])|(14(0|[5-7]|9))|(15([0-3]|[5-9]))|(16(2|[5-7]))|(17[0-8])|(18[0-9])|(19([0-3]|[5-9])))\\d{8}$"
;
public
static
final
String
REG_EMAIL
=
"[a-zA-Z0-9]+@[a-zA-Z0-9]+\\.[a-zA-Z0-9]+"
;
/**
* 校验email
* @param email
* @return
*/
public
static
boolean
isEmail
(
String
email
){
if
(
email
==
null
){
return
false
;
}
else
{
boolean
isMatch
=
Pattern
.
matches
(
REG_EMAIL
,
email
);
return
isMatch
;
}
}
/**
* 校验手机号
* @param phone
* @return
*/
public
static
boolean
isPhone
(
String
phone
){
if
(
phone
==
null
){
return
false
;
}
else
{
Pattern
p
=
Pattern
.
compile
(
REG_Moblie
);
Matcher
m
=
p
.
matcher
(
phone
);
return
m
.
matches
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment