re-matches

functionsince v0.0-927 clojure.core/re-matchesEdit
(re-matches re s)

Details:

Returns the result of (re-find re s) if re fully matches s.


Source docstring:
Returns the result of (re-find re s) if re fully matches s.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(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."))))