A namespace for those quick "I need something better than a regex"-moments.
A namespace for those quick "I need something better than a regex"-moments.
(parse definition text)
Quickly parse text
using the string- or data parser definition
.
The definition cannot be recursive. The predefined parsers in the
built-ins
namespace are available.
A success result is transformed such that the matched texts are directly available. For example:
(parse "'alice' (' and ' (:who word))+"
"alice and bob and eve")
=> [nil "alice and bob and eve"
[:who "bob"]
[:who "eve"]]
When the result is an error, nil is returned.
Quickly parse `text` using the string- or data parser `definition`. The definition cannot be recursive. The predefined parsers in the `built-ins` namespace are available. A success result is transformed such that the matched texts are directly available. For example: (parse "'alice' (' and ' (:who word))+" "alice and bob and eve") => [nil "alice and bob and eve" [:who "bob"] [:who "eve"]] When the result is an error, nil is returned.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close