Hi,

On Monday, March 18, 2013 12:50:13 PM UTC+1, Marko Topolnik wrote:
>
> Dynamic regex building is a standard technique. Unfortunately, once you 
> leave the regex literal world, you are back to escaping everything.


this works pretty well, at least better than I expected, e.g.:

 user=> (def r1 #"(\s.)")
#'user/r1
user=> (def r2 #"([abc])")
#'user/r2
user=> (def r3 (re-pattern (str r1 "|" r2)))
#'user/r3
user=> r3
#"(\s.)|([abc])"
user=> (re-find r3 " x")
[" x" " x" nil]
user=> (re-find r3 "b")
["b" nil "b"]


Regards,
Stefan

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to