refined nick matching patter. word boundry (\b) doesn’t match on words ending in a boundry
fixes #3249
This commit is contained in:
parent
18752a5c58
commit
03cd176c27
|
@ -98,7 +98,7 @@ public class NotificationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Pattern generateNickHighlightPattern(final String nick) {
|
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)
|
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||||
|
|
Loading…
Reference in New Issue