I was simply proposing a slight modification to Chouser's code:

(defn my-regex [words]
 (re-pattern
   (.replace (str #"(.*?)(\((?:WORDS).*)")
             "WORDS"
             (str-join "|" (map #(Pattern/quote %) words)))))

It will escape special characters in words.

On Thu, Jun 25, 2009 at 5:41 PM, CuppoJava <patrickli_2...@hotmail.com>wrote:

>
> 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
> >
>


-- 
Professional: http://cgrand.net/ (fr)
On Clojure: http://clj-me.blogspot.com/ (en)

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to