JanetDocsSign in with Github

peg/match



    cfunction

    (peg/match peg text &opt start & args)
    
    Match a Parsing Expression Grammar to a byte string and return an
    array of captured values. Returns nil if text does not match the
    language defined by peg. The syntax of PEGs are very similar to those
    defined by LPeg, and have similar capabilities.


1 exampleSign in to add an example
Loading...
(peg/match ~{:main (capture (some :S))}
           "hello world")              # => @["hello"]
sogaiu