StringRecognizer

class StringRecognizer(val toRecognize: String) : TokenRecognizer

Implementation of a TokenRecognizer that attempts to recognize a given string exactly. It will return a pair with the matched string and the ending index (exclusive) if recognized.

Constructors

Link copied to clipboard
constructor(toRecognize: String)

Functions

Link copied to clipboard
open override fun recognize(s: String, startAt: Int): Pair<String, Int>?

Check whether the string s starting from index startAt matches the pattern this recognizer uses.

Properties

Link copied to clipboard

The string that should be recognized by this StringRecognizer