Package 

Class MentionRegexKt

    • Method Summary

      Modifier and Type Method Description
      final static Regex mentionRegex(String display) Builds the regex used to locate a mention token (@<display>) inside message text.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 @).