Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
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
openSource
apollo
Commits
58f5ef30
Commit
58f5ef30
authored
Dec 09, 2016
by
Harris Zhang
Committed by
GitHub
Dec 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix regex error
parent
8940dc6c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
InputValidator.java
...m/ctrip/framework/apollo/common/utils/InputValidator.java
+3
-3
No files found.
apollo-common/src/main/java/com/ctrip/framework/apollo/common/utils/InputValidator.java
View file @
58f5ef30
...
@@ -11,8 +11,8 @@ import java.util.regex.Pattern;
...
@@ -11,8 +11,8 @@ import java.util.regex.Pattern;
public
class
InputValidator
{
public
class
InputValidator
{
public
static
final
String
INVALID_CLUSTER_NAMESPACE_MESSAGE
=
"只允许输入数字,字母和符号 - _ ."
;
public
static
final
String
INVALID_CLUSTER_NAMESPACE_MESSAGE
=
"只允许输入数字,字母和符号 - _ ."
;
public
static
final
String
INVALID_NAMESPACE_NAMESPACE_MESSAGE
=
"不允许以.json, .yml, .yaml, .xml, .properties结尾"
;
public
static
final
String
INVALID_NAMESPACE_NAMESPACE_MESSAGE
=
"不允许以.json, .yml, .yaml, .xml, .properties结尾"
;
public
static
final
String
CLUSTER_NAMESPACE_VALIDATOR
=
"[0-9a-zA-
z
_.-]+"
;
public
static
final
String
CLUSTER_NAMESPACE_VALIDATOR
=
"[0-9a-zA-
Z
_.-]+"
;
public
static
final
String
APP_NAMESPACE_VALIDATOR
=
"[a-zA-
z
0-9._-]+(?<!\\.(json|yml|yaml|xml|properties))$"
;
public
static
final
String
APP_NAMESPACE_VALIDATOR
=
"[a-zA-
Z
0-9._-]+(?<!\\.(json|yml|yaml|xml|properties))$"
;
private
static
final
Pattern
CLUSTER_NAMESPACE_PATTERN
=
private
static
final
Pattern
CLUSTER_NAMESPACE_PATTERN
=
Pattern
.
compile
(
CLUSTER_NAMESPACE_VALIDATOR
);
Pattern
.
compile
(
CLUSTER_NAMESPACE_VALIDATOR
);
private
static
final
Pattern
APP_NAMESPACE_PATTERN
=
private
static
final
Pattern
APP_NAMESPACE_PATTERN
=
...
@@ -28,6 +28,6 @@ public class InputValidator {
...
@@ -28,6 +28,6 @@ public class InputValidator {
if
(
StringUtils
.
isEmpty
(
name
)){
if
(
StringUtils
.
isEmpty
(
name
)){
return
false
;
return
false
;
}
}
return
CLUSTER_NAMESPACE_PATTERN
.
matcher
(
name
.
toLowerCase
()
).
matches
()
&&
APP_NAMESPACE_PATTERN
.
matcher
(
name
).
matches
();
return
CLUSTER_NAMESPACE_PATTERN
.
matcher
(
name
).
matches
()
&&
APP_NAMESPACE_PATTERN
.
matcher
(
name
).
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