This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-22
Channels
- # architecture (1)
- # aws (3)
- # beginners (78)
- # boot (33)
- # cider (49)
- # cljs-dev (3)
- # clojure (82)
- # clojure-berlin (2)
- # clojure-dusseldorf (14)
- # clojure-gamedev (75)
- # clojure-italy (15)
- # clojure-nl (2)
- # clojure-poland (9)
- # clojure-russia (1)
- # clojure-spec (11)
- # clojure-uk (91)
- # clojurescript (17)
- # core-async (2)
- # cursive (1)
- # data-science (3)
- # datascript (34)
- # datomic (13)
- # docs (2)
- # duct (32)
- # emacs (8)
- # fulcro (95)
- # instaparse (17)
- # jobs (2)
- # jobs-discuss (1)
- # jobs-rus (4)
- # leiningen (1)
- # luminus (1)
- # lumo (4)
- # mount (1)
- # nrepl (1)
- # off-topic (98)
- # onyx (13)
- # portkey (12)
- # re-frame (10)
- # reagent (11)
- # remote-jobs (4)
- # rum (3)
- # shadow-cljs (34)
- # specter (7)
- # sql (1)
- # tools-deps (8)
Hey! I want to spec for five characters long numbers: I could use regexes #(re-matches #"\d{5}" %)
, but I as far as I can understand that could be done in spec. I looked up a bit, but what I found is only s/* s/+ s/?
that kind of operators. So, is there that kind of spec? I know about s/cat
- but that seem too overkill for when I just want to repeat my regex
I want to have more composable regexes and spec seem suited for that, compared to regular regexes
spec is not designed to be a good string regex parser and is unlikely to perform or work well for that use case as actual regex or a parser
you might find something like https://github.com/cgrand/regex interesting
I want to say there is something else like this out there for composable regexes too
@troglotit The comment thread on this reddit post goes into some of the issues you may run into when using spec for parsing strings https://www.reddit.com/r/Clojure/comments/7vwpu4/parsing_with_clojurespec/