Getting all matches for a regexp on clojure

Posted by Deleteman on Stack Overflow See other posts from Stack Overflow or by Deleteman
Published on 2012-06-04T21:33:02Z Indexed on 2012/06/04 22:40 UTC
Read the original article Hit count: 121

Filed under:
|

I'm trying to parse an HTML file and get all href's inside it.

So far, the code I'm using is:

(map 
   #(println (str "Match: " %)) 
   (re-find #"(?sm)href=\"([a-zA-Z.:/]+)\"" str_response))

str_response being the string with the HTML code inside it. According to my basic understanding of Clojure, that code should print a list of matches, but so far, no luck. It doens't crash, but it doens't match anything either. I've tried using re-seq instead of re-find, but with no luck. Any help?

Thanks!

© Stack Overflow or respective owner

Related posts about regex

Related posts about clojure