I'm trying to create a macro that accepts 2 strings, 1 would be a regex pattern and the other a string to test it on. From some reading (including around here) and seeing as #"" is a reader macro I tried doing it using re-pattern but it seems to fail at runtime with:
Exception in thread "main" java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.CharSequence
My code:
(defmacro checkre [ strre strstring ]
(re-find (re-pattern strre) strstring))
Example call:
(defn hasthing [xp]
(checkre "(?i)^.*blabla" xp))
Thanks!