Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
c2a96a4d
Commit
c2a96a4d
authored
Nov 23, 2017
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修正正则
parent
48220509
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
10 deletions
+1
-10
ValidationUtil.java
src/main/java/cn/quantgroup/xyqb/util/ValidationUtil.java
+1
-10
No files found.
src/main/java/cn/quantgroup/xyqb/util/ValidationUtil.java
View file @
c2a96a4d
...
...
@@ -16,7 +16,7 @@ public class ValidationUtil {
private
static
String
phoneRegExp
=
"^((13[0-9])|(14[0-9])|(15[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\\d{8}$"
;
private
static
String
chineseNameRegExp
=
"^[\u4e00-\u9fa5]+(\\.|·)?[\u4e00-\u9fa5]+$"
;
private
static
String
ipv4RegExp
=
"^((2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)\\.){3}(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)$"
;
private
static
String
localIpv4RegExp
=
"^172
\\.(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?
){3}$"
;
private
static
String
localIpv4RegExp
=
"^172
(\\.(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)
){3}$"
;
private
static
Pattern
phonePattern
=
Pattern
.
compile
(
phoneRegExp
);
private
static
Pattern
chinesePattern
=
Pattern
.
compile
(
chineseNameRegExp
);
...
...
@@ -73,13 +73,4 @@ public class ValidationUtil {
return
false
;
}
public
static
void
main
(
String
[]
args
){
System
.
out
.
println
(
ValidationUtil
.
validateIpv4
(
"49.150.23.2"
));
System
.
out
.
println
(
ValidationUtil
.
validateIpv4
(
"172.16.4.3"
));
System
.
out
.
println
(
ValidationUtil
.
validateIpv4
(
"192.168.8.9"
));
System
.
out
.
println
(
ValidationUtil
.
validateLocalIpv4
(
"49.150.23.2"
));
System
.
out
.
println
(
ValidationUtil
.
validateLocalIpv4
(
"172.16.4.3"
));
System
.
out
.
println
(
ValidationUtil
.
validateLocalIpv4
(
"192.168.8.9"
));
}
}
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