refined nick matching patter. word boundry (\b) doesn’t match on words ending in a boundry

fixes #3249
This commit is contained in:
Daniel Gultsch 2018-10-25 15:33:35 +02:00
parent 18752a5c58
commit 03cd176c27

View file

@ -98,7 +98,7 @@ public class NotificationService {
}
public static Pattern generateNickHighlightPattern(final String nick) {
return Pattern.compile("(?<=(^|\\s))" + Pattern.quote(nick) + "\\b");
return Pattern.compile("(?<=(^|\\s))" + Pattern.quote(nick) + "(?=\\s|$|\\p{Punct})");
}
@RequiresApi(api = Build.VERSION_CODES.O)