MentionParser

An IMfmParser implementation for detecting "mention" syntax. The string starting with "@" will be the search result.

Notes

  • If the first character before the @ matches a-z0-9 (case-insensitive) it will not be recognized as a mention.

  • Username must be at least 1 letter.

  • a-z0-9_- (case-insensitive) can be used for the Username.

  • Username cannot start or end with "-".

  • Host name must be at least 1 character.

  • a-z0-9_-. (not case sensitive) can be used in the hostname.

  • The host name cannot start or end with '-' or '.'

Types

Link copied to clipboard

Functions

Link copied to clipboard
open override fun find(input: String, startAt: Int, context: IMfmParserContext): IMfmParserResult

Finds a substring in the input string starting from a given index.

Link copied to clipboard
open fun not(): IMfmParser

Returns a negative (not) version of the current MFM parser. A negative parser will return a failure result if the substring is found.

Link copied to clipboard
open fun optional(): IMfmParser

Returns an optional version of the current substring parser. An optional parser will return a successful result even if the substring is not found.