re-find

functionsince v0.0-927 clojure.core/re-findEdit
(re-find re s)

Details:

Returns the first regex match, if any, of s to re, using re.exec(s).

Returns a vector, containing first the matching substring, then any capturing groups if the regular expression contains capturing groups.


Source docstring:
Returns the first regex match, if any, of s to re, using
re.exec(s). Returns a vector, containing first the matching
substring, then any capturing groups if the regular expression contains
capturing groups.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn re-find
  [re s]
  (if (string? s)
    (let [matches (.exec re s)]
      (when-not (nil? matches)
        (if (== (count ^array matches) 1)
          (aget matches 0)
          (vec matches))))
    (throw (js/TypeError. "re-find must match against a string."))))