What is the optimal way to couple multiple regular expressions within a Clojure function? I believe the function would start out as such:
(defn foo [x]
(re-seq #"some means to combine multiple regex")
but am not clear if this is will work, or the efficiency of such a function. To provide an example of possible regex coupling, one might consider a function which searched for both domain names and IP. For domain names I'd use a regex as such:
(re-seq #"\b([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}\b" x)
and for IP:
(re-seq #"\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b")