Fork me on GitHub

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 need to verify in the middle of the string


I was only using the re-matcher because it allowed me to extract the regexp groups correctly

Dante T. M.03:01:34

@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:

❤️ 5

The handful of threads quote is somewhat misleading


You can create a ton of threads


The only limit I have ever hit (on the number if threads) is the os limit, which generally can be increased without any problem


And I have created a lot of threads

Dante T. M.14:01:48

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

Daw-Ran Liou22:01:04

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.