Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
relation
Commits
5039e026
Commit
5039e026
authored
Sep 09, 2025
by
wujipeng
Browse files
优化
parent
e3d58e5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/platform/service/impl/AnalysisServiceImpl.java
View file @
5039e026
...
@@ -350,10 +350,13 @@ public class AnalysisServiceImpl implements AnalysisService {
...
@@ -350,10 +350,13 @@ public class AnalysisServiceImpl implements AnalysisService {
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
trimChineseNameFromFilename
(
"张三-05_2023-07-05_2023-07-05_2023-07-05_2023-07-0"
));
System
.
out
.
println
(
trimChineseNameFromFilename
(
null
));
}
}
public
static
String
trimChineseNameFromFilename
(
String
filename
)
{
public
static
String
trimChineseNameFromFilename
(
String
filename
)
{
if
(
filename
==
null
)
{
return
""
;
}
// 正则表达式匹配连续的中文字符
// 正则表达式匹配连续的中文字符
Pattern
pattern
=
Pattern
.
compile
(
"[\u4e00-\u9fa5]+"
);
Pattern
pattern
=
Pattern
.
compile
(
"[\u4e00-\u9fa5]+"
);
Matcher
matcher
=
pattern
.
matcher
(
filename
);
Matcher
matcher
=
pattern
.
matcher
(
filename
);
...
...
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