X Tutup
Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/clj/clojure/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4290,6 +4290,16 @@
(when (. m (find))
(cons (re-groups m) (lazy-seq (step))))))))

(defn re-count
"Returns the total number of matches of pattern in string."
[re s]
(count (re-seq re s)))

(defn re-count-uniq
"Returns the total number of unique matches of pattern in string."
[re s]
(count (set (re-seq re s))))

(defn re-matches
"Returns the match, if any, of string to pattern, using
java.util.regex.Matcher.matches(). Uses re-groups to return the
Expand Down
X Tutup