From b0599b923df86cf4bc9b2657aa2881bb6e70b9bc Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Thu, 8 Nov 2018 06:47:50 +0100 Subject: =?UTF-8?q?refined=20nick=20matching=20patter.=20word=20boundry=20?= =?UTF-8?q?(\b)=20doesn=E2=80=99t=20match=20on=20words=20ending=20in=20a?= =?UTF-8?q?=20boundry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/de/pixart/messenger/services/NotificationService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/de/pixart/messenger/services') diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java index c60e652bb..3d19e05c7 100644 --- a/src/main/java/de/pixart/messenger/services/NotificationService.java +++ b/src/main/java/de/pixart/messenger/services/NotificationService.java @@ -101,7 +101,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) -- cgit v1.2.3