[strs]
(->> strs
(clojure.string/join "|")
- (format "(?:%s)")))
+ (format "(?:%s)")
+ re-pattern))
;; Shuffle 10000 words and build a naive and frak pattern from them.
(def ws (shuffle (take 10000 words)))
;; Naive pattern
(bench (doseq [w ws'] (re-matches n-pat w)))
-
;; Execution time mean : 1.499489 sec
;; Execution time std-deviation : 181.365166 ms
;; Execution time lower quantile : 1.337817 sec ( 2.5%)