match

fun match(pattern: String, consume: Boolean = true, caseInsensitive: Boolean = false): Boolean

Match the input against the given string. If consume is true (default), advance past the matched text. When caseInsensitive is true, the match is case-insensitive.


fun match(pattern: Regex, consume: Boolean = true): MatchResult?

Match the input against the given regex (which should start with ^). If consume is true (default), advance past the matched text. Returns the match result if it matches at the current position, or null.