peg-search ( string parser -- seq )


Vocabulary
peg.search

Inputs
stringa string
parsera peg based parser


Outputs
seqa sequence


Word description
Returns a sequence containing the parse results of all substrings from the input string that successfully parse using the parser.
USING: peg.parsers peg.search prettyprint ; "one 123 two 456" integer-parser peg-search .
V{ 123 456 }

USING: peg peg.parsers peg.search prettyprint ; "one 123 \"hello\" two 456" integer-parser string-parser 2choice peg-search .
V{ 123 "hello" 456 }


See also
peg-replace

Definition