On Monday, March 18, 2013 8:59:27 PM UTC+1, Andy Fingerhut wrote:
>
>  str is based on the toString() method of java.util.regex.Pattern, so I do 
> not understand why you say it only works if you build up from parts that 
> are literal regexes.  For example:
>
> user=> (def r1 (re-pattern "\\sfoo|bar\\d+"))
> #'user/r1
> user=> (def r2 (re-pattern "taking over the world( world)*\\b"))
> #'user/r2
> user=> (def r3 (re-pattern (str "(" r1 ")|(" r2 ")")))
> #'user/r3
> user=> r3
>

Well obviously, you aren't benefiting from the literal regex syntax here :) 
Stefan's point was using the literal syntax to avoid double-backslashes and 
such, while still programmatically building up the full regex.

-marko
 

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to