Hi Jung,

Look at clojure.contrib.str-utils2/replace -- you can pass a function
as the replacement parameter and make any substitutions you want.

-SS


On Sep 28, 6:51 pm, Jung Ko <[email protected]> wrote:
> Does anyone know how I can replace a string with back-reference? I'd
> like something like this:
>
> (use clojure.contrib.str-utils)
> (re-sub #"hello (\S+)" ", how are you \1?" "hello Jung")
> => "hello, how are you Jung?"
>
> Basically I need the back reference \1 to evaluate to "Jung" in the
> above case. Is there an easy way to do this?
>
> Thanks,
> Jung
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to