This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-02
Channels
- # announcements (1)
- # beginners (15)
- # calva (6)
- # cider (72)
- # clojure (105)
- # clojure-europe (2)
- # clojure-france (1)
- # clojure-italy (4)
- # clojure-nl (2)
- # clojure-uk (32)
- # clojurescript (14)
- # code-reviews (10)
- # cursive (8)
- # data-science (2)
- # datomic (38)
- # events (1)
- # fulcro (31)
- # graphql (1)
- # hyperfiddle (47)
- # java (4)
- # jobs (4)
- # off-topic (18)
- # overtone (2)
- # parinfer (12)
- # pathom (19)
- # pedestal (4)
- # philosophy (2)
- # portkey (22)
- # re-frame (42)
- # reagent (1)
- # rum (1)
- # shadow-cljs (36)
- # specter (3)
- # tools-deps (2)
re-matcher
returns an instance of java.util.regex.Matcher
, according to the doc string. The Java docs for that say that such a matcher is intended only for matching a regex against the entire input string, not only a part of it.
Or at least the matches
method of it.
Did you want to look for possible matches of the regex in the middle of the string input
, or only matches that match the entire string?
I was only using the re-matcher
because it allowed me to extract the regexp groups correctly
@hiredman @veix.q5 this is from Clojure For The Brave and True: It all comes down to efficiency. Because go blocks use a thread pool with a fixed size, you can create 1,000 go processes but use only a handful of threads:
(def hi-chan (chan))
(doseq [n (range 1000)]
(go (>! hi-chan (str "hi " n))))
Worth a look: https://www.braveclojure.com/core-async/#Getting_Started_with_ProcessesThe only limit I have ever hit (on the number if threads) is the os limit, which generally can be increased without any problem
Fair enough. I just like the resource for being extremely beginner-friendly.
@iagwanderson re-find
can also return the values of capture groups, if you parenthesize them in the regex expression.
user=> (re-find #"^([a-z])([A-Z][a-z])*([A-Z]?)$" "dAaBbC")
["dAaBbC" "d" "Bb" "C"]
thanks @andy.fingerhut didn't notice that
Hi everyone, I've working on a toy project for a while and would love some code reviews / feedbacks on the clojurescript code that I wrote. Thanks. https://github.com/dawran6/markdown-editor