Package com.theonlytails.ketex

Types

Link copied to clipboard
class KetexBuilder : KetexFragment
Link copied to clipboard
abstract class KetexFragment
Link copied to clipboard
class KetexGroup(type: KetexGroup.KetexGroupType, name: String) : KetexFragment, KetexToken
Link copied to clipboard
Link copied to clipboard
class KetexSet(negate: Boolean) : KetexFragment, KetexToken
Link copied to clipboard
fun interface KetexToken

Functions

Link copied to clipboard
infix fun KetexToken.atLeast(min: Int): KetexToken

Appends a minimum quantifier ({3,}) to the current token.

Link copied to clipboard
infix fun KetexToken.between(range: IntRange): KetexToken

Appends a range quantifier ({1,3}) to the current token.

Link copied to clipboard
inline fun buildRegex(block: KetexBuilder.() -> Unit): KetexBuilder
Link copied to clipboard
infix fun KetexToken.count(count: Int): KetexToken

Appends an exact quantifier ({3}) to the current token.

Link copied to clipboard
inline fun group(    type: KetexGroup.KetexGroupType = KetexGroupType.Capture,     name: String = "",     block: KetexGroup.() -> Unit): KetexGroup
Link copied to clipboard
fun KetexToken.lazy(): KetexToken

Appends a lazy modifier (?) to the previous quantifier.

Link copied to clipboard
fun KetexToken.maybe(): KetexToken

Appends a star quantifier (*) to the current token.

Link copied to clipboard
operator fun KetexToken.not(): KetexToken
Link copied to clipboard
fun KetexToken.option(): KetexToken

Appends an optional quantifier (?) to the current token.

Link copied to clipboard
infix fun KetexToken.or(other: KetexToken): KetexToken

Appends an alternation token (|) to the current token.

Link copied to clipboard
inline fun regex(vararg flags: RegexOption, block: KetexBuilder.() -> Unit): Regex
Link copied to clipboard
inline fun regexAsString(block: KetexBuilder.() -> Unit): String
Link copied to clipboard
inline fun set(negate: Boolean = false, block: KetexSet.() -> Unit): KetexSet

Create a character set ([abcedfu]) to the regex.

Link copied to clipboard
fun KetexToken.some(): KetexToken

Appends a plus quantifier (+) to the current token.

Properties

Link copied to clipboard
val any: KetexToken

Append an "any character" token (.) to the regex.

Link copied to clipboard
val carriageReturn: KetexToken

Append a carriage return token (\r) to the regex.

Link copied to clipboard
val category: (Character.UnicodeScript) -> KetexToken

Append a subpattern/backreference token (\#) to the regex.

Link copied to clipboard
val digit: KetexToken

Append a digit token (\d) to the regex.

Link copied to clipboard
val end: KetexToken

Append an ending anchor ($) to the regex.

Link copied to clipboard
val horizontalWhitespace: KetexToken

Append a horizontal whitespace token (\h) to the regex.

Link copied to clipboard
val index: (Int) -> KetexToken

Append a subpattern/backreference token (\#) to the regex.

Link copied to clipboard
val newline: KetexToken

Append a newline character token (\n) to the regex.

Link copied to clipboard
val start: KetexToken

Append a start anchor (^) to the regex.

Link copied to clipboard
val tab: KetexToken

Append a tab character token (\t) to the regex.

Link copied to clipboard
val String.token: KetexToken
val Char.token: KetexToken
val CharRange.token: KetexToken
Link copied to clipboard
val unicodeNewlines: KetexToken

Append a unicode newlines token (\R) to the regex.

Link copied to clipboard
val verticalWhitespace: KetexToken

Append a vertical whitespace token (\v) to the regex.

Link copied to clipboard
val whitespace: KetexToken

Append a whitespace token (\s) to the regex.

Link copied to clipboard
val word: KetexToken

Append a word token (\w) to the regex.

Link copied to clipboard
val wordBoundary: KetexToken

Append a word boundary anchor (\b) to the regex.