textConvert
    Preparing search index...

    Function extractMentions

    • Extracts all

      Parameters

      • text: string

        Text to search for mentions.

      Returns string[]

      An array of the mentions found (including the leading @), in the order they appear.

      found in a block of text, symbol included.

      A match only starts when the @ isn't immediately preceded by a letter/digit/underscore, so an email address's @ (e.g. user@example.com) is never mistaken for a mention.

      extractMentions('Thanks
      

      and @alex_dev for the review!'); // ['@jordan', '@alex_dev']