Learn R Programming

Ramble (version 0.1.1)

maybe: maybe matches 0 or 1 of pattern p. In EBNF notation, this corresponds to a question mark ('?').

Description

maybe matches 0 or 1 of pattern p. In EBNF notation, this corresponds to a question mark ('?').

Usage

maybe(p)

Arguments

p
is the parser to be matched 0 or 1 times.

See Also

many, some

Examples

Run this code
maybe(Digit())("123abc")
maybe(Digit())("abc123")

Run the code above in your browser using DataLab