Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
cloud-phantom
/
common
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
22578fa0
authored
Nov 28, 2018
by
朱亚东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改密码校验规则
parent
bdb304fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
src/main/java/com/kingboy/common/utils/regex/RegexUtils.java
+2
-3
No files found.
src/main/java/com/kingboy/common/utils/regex/RegexUtils.java
View file @
22578fa0
...
...
@@ -97,7 +97,6 @@ public final class RegexUtils {
return
ip
.
matches
(
regex
);
}
/**
* 判断是否含有中文,仅适合中国汉字,不包括标点
* @param text
...
...
@@ -112,7 +111,7 @@ public final class RegexUtils {
}
/**
* 判断密码是否符合标准:规则:6-16位
必须是大写字母开头含有数字
,不能有特殊字符的密码
* 判断密码是否符合标准:规则:6-16位
数字和字母组合
,不能有特殊字符的密码
* @param str
* @return boolean true,通过,false,没通过
*/
...
...
@@ -121,7 +120,7 @@ public final class RegexUtils {
return
false
;
}
String
pattern
=
"^
[A-Z](?=.*[0-9].*)[A-Za-z0-9]{5,15
}$"
;
String
pattern
=
"^
(?=.*[0-9].*)(?=.*[a-z].*)[A-Za-z0-9]{6,16
}$"
;
Pattern
r
=
Pattern
.
compile
(
pattern
);
Matcher
m
=
r
.
matcher
(
str
);
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