function | since v0.0-927 | clojure.core/re-matches | Edit |
(re-matches re s)
Returns the result of (re-find re s)
if re
fully matches s
.
Returns the result of (re-find re s) if re fully matches s.
(defn re-matches
[re s]
(if (string? s)
(let [matches (.exec re s)]
(when (and (not (nil? matches))
(= (aget matches 0) s))
(if (== (count ^array matches) 1)
(aget matches 0)
(vec matches))))
(throw (js/TypeError. "re-matches must match against a string."))))