import org.eclipse.jgit.util.RelativeDateFormatter;
+import com.gitblit.Constants;
+
/**
* The Gitblit Ticket model, its component classes, and enums.
*
}
try {
- Pattern mentions = Pattern.compile("\\s@([A-Za-z0-9-_]+)");
+ Pattern mentions = Pattern.compile(Constants.REGEX_TICKET_MENTION);
Matcher m = mentions.matcher(text);
while (m.find()) {
String username = m.group(1);
// cc users mentioned in last comment
Change lastChange = ticket.changes.get(ticket.changes.size() - 1);
if (lastChange.hasComment()) {
- Pattern p = Pattern.compile("\\s@([A-Za-z0-9-_]+)");
+ Pattern p = Pattern.compile(Constants.REGEX_TICKET_MENTION);
Matcher m = p.matcher(lastChange.comment.text);
while (m.find()) {
String username = m.group();
import org.pegdown.PegDownProcessor;\r
import org.pegdown.ast.RootNode;\r
\r
+import com.gitblit.Constants;\r
import com.gitblit.IStoredSettings;\r
import com.gitblit.Keys;\r
import com.gitblit.wicket.MarkupProcessor.WorkaroundHtmlSerializer;\r
\r
// emphasize and link mentions\r
String mentionReplacement = String.format(" **[@$1](%1s/user/$1)**", canonicalUrl);\r
- text = text.replaceAll("\\s@([A-Za-z0-9-_]+)", mentionReplacement);\r
+ text = text.replaceAll(Constants.REGEX_TICKET_MENTION, mentionReplacement);\r
\r
// link ticket refs
String ticketReplacement = MessageFormat.format("$1[#$2]({0}/tickets?r={1}&h=$2)$3", canonicalUrl, repositoryName);