Re: Concatenating Regexes?

2009-06-25 Thread Chouser
On Wed, Jun 24, 2009 at 9:04 PM, Chouserchou...@gmail.com wrote: On Wed, Jun 24, 2009 at 6:13 PM, CuppoJavapatrickli_2...@hotmail.com wrote: I need to dynamically create a regex, and would really like to be able to use Clojure's built-in regex syntax. But I don't know how to go about it.

Re: Concatenating Regexes?

2009-06-25 Thread Christophe Grand
On Thu, Jun 25, 2009 at 4:05 PM, Chouser chou...@gmail.com wrote: On Wed, Jun 24, 2009 at 9:04 PM, Chouserchou...@gmail.com wrote: On Wed, Jun 24, 2009 at 6:13 PM, CuppoJavapatrickli_2...@hotmail.com wrote: I need to dynamically create a regex, and would really like to be able to use

Re: Concatenating Regexes?

2009-06-25 Thread CuppoJava
I don't know what you mean by Pattern/quote, can you give me an example? And I really like Chouser's second method. That's very tidy! Thanks Chouser -Patrick --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure

Concatenating Regexes?

2009-06-24 Thread CuppoJava
Hi, I need to dynamically create a regex, and would really like to be able to use Clojure's built-in regex syntax. But I don't know how to go about it. My regex is: #(.*?)(\(image .*) except instead of image, I need to dynamically insert an array of possible strings to match. ie. given [image

Re: Concatenating Regexes?

2009-06-24 Thread Stephen C. Gilardi
On Jun 24, 2009, at 6:13 PM, CuppoJava wrote: Is there a nice way of doing this without having to go back to using Java's string syntax? I don't see a nice way to do it. You can use either (java.util.rexex.Pattern/compile my-str) or (with-in-str (str \# \ my-str \) (read)) to

Re: Concatenating Regexes?

2009-06-24 Thread Asbjørn Bjørnstad
On Jun 25, 6:13 am, CuppoJava patrickli_2...@hotmail.com wrote: Hi, I need to dynamically create a regex, and would really like to be able to use Clojure's built-in regex syntax. But I don't know how to go about it. My regex is: #(.*?)(\(image .*) except instead of image, I need to

Re: Concatenating Regexes?

2009-06-24 Thread Chouser
On Wed, Jun 24, 2009 at 6:13 PM, CuppoJavapatrickli_2...@hotmail.com wrote: I need to dynamically create a regex, and would really like to be able to use Clojure's built-in regex syntax. But I don't know how to go about it. My regex is: #(.*?)(\(image .*) except instead of image, I need

Re: Concatenating Regexes?

2009-06-24 Thread CuppoJava
Thanks for all your help guys. Chouser's solution seems to be the best that can be done so far. It's funny, before I learned Clojure, I wouldn't give a second thought to string twiddling like this. But ever since learning Clojure, I've been pretty reluctant to do anything messy. Thanks again