Regular expression combinators


The regexp.combinators vocabulary defines combinators which can be used to build up regular expressions to match strings. This complements the traditional syntax defined in the regexp vocabulary.
Regular expression combinator rationale

Basic combinators:
<literal> ( string -- regexp )

<nothing> ( -- value )


Higher-order combinators for building new regular expressions from existing ones:
<or> ( regexps -- disjunction )

<and> ( regexps -- conjunction )

<not> ( regexp -- not-regexp )

<sequence> ( regexps -- regexp )

<zero-or-more> ( regexp -- regexp* )


Derived combinators implemented in terms of the above:
<one-or-more> ( regexp -- regexp+ )


Setting options:
<option> ( regexp -- regexp? )