JanetDocsI'm feeling luckyGithub sign in

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 is documented on the Janet
    website.


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