-
public final class MentionRegexKt
-
-
Method Summary
Modifier and Type Method Description final static RegexmentionRegex(String display)Builds the regex used to locate a mention token ( @<display>) inside message text.-
-
Method Detail
-
mentionRegex
final static Regex mentionRegex(String display)
Builds the regex used to locate a mention token (
@<display>) inside message text.The boundaries use Unicode-aware lookaround, because Java's default word-boundary classes only recognize ASCII
[A-Za-z0-9_]. The lookbehind(?<![\p{L}\p{N}_])also naturally handles the start-of-string case.An empty display returns a regex that never matches, to prevent a bare
@regression.- Parameters:
display- The literal display text of the mention (without the leading@).
-
-
-
-