Skip to content

Commit

Permalink
修改fetchAt方法的正则
Browse files Browse the repository at this point in the history
  • Loading branch information
tomoya committed Dec 6, 2016
1 parent b69feb7 commit 2f0988a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/cn/tomoya/common/BaseEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ public String marked(String content) {
*/
public static List<String> fetchUsers(String str) {
List<String> ats = new ArrayList<>();
String pattern = "@";
String pattern = "@[^\\s]+\\s?";
Pattern regex = Pattern.compile(pattern);
Matcher regexMatcher = regex.matcher(str);
while (regexMatcher.find()) {
ats.add(regexMatcher.group(1));
ats.add(regexMatcher.group());
}
return ats;
}
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/cn/tomoya/template/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Created by tomoya.
* Copyright (c) 2016, All Rights Reserved.
* http://tomoya.cn
*/
package cn.tomoya.template;

/**
这个包是做freemarker自定义标签的,暂时没有在系统里用到,先保留
*/

0 comments on commit 2f0988a

Please sign in to comment.