option

fun option(pattern: RuleBuilder<*>.() -> Unit): RuleBuilder<N>

Adds an OptionalElement (matches 0 or 1 times).

This is equivalent to repeat(min = 0, max = 1, pattern).

Return

this RuleBuilder for chaining

Parameters

pattern

A lambda defining the optional element(s)