RegexBuilder

Supports the regex builder function.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun anyOf(vararg builders: RegexBuilder.() -> Unit): RegexBuilder

Combines multiple builders into a single builder, separated by the OR operator (|).

Link copied to clipboard
fun append(pattern: String): RegexBuilder

Appends a pattern to the regex builder, injecting the language in the IDE.

Link copied to clipboard

The same as append, except without the language injection. This is for special cases where the IDE incorrectly flags the pattern -- hopefully just because it doesn't have enough context.

Link copied to clipboard
inline fun grouped(groupStart: String, groupEnd: String, builder: RegexBuilder.() -> Unit): RegexBuilder

Groups a segment of a regular expression, with the groupStart and groupEnd parameters marking the start and end of the group respectively.

Link copied to clipboard

Appends the OR operator (|) to the regex builder.

Link copied to clipboard
inline fun regex(builder: RegexBuilder.() -> Unit): String

overload for building a regex inside a regex builder

Link copied to clipboard
inline fun section(builder: RegexBuilder.() -> Unit): RegexBuilder

This just provides an indent around related parts of the pattern. Defines a section of the regular expression string. The builder function is applied to the RegexBuilderScope to define the section content.