Re: How to convert string into sequence with replacing matched text.

2012-02-13 Thread Takahiro
Tassilo Thank you for sharering your solution. I've just solved this problem in ClojureScript as follows. (defn foobar [acc s] (if-let [[_ pre m post] (re-find #"(.*?)(>>\d+)(.*)" s)] (recur (conj acc pre [m]) post) (conj acc s))) (foobar [] "hello >>1 hello>>33") ;=> ["hello " ["

Re: How to convert string into sequence with replacing matched text.

2012-02-12 Thread Tassilo Horn
Takahiro Hozumi writes: Hi! > I want to make a sequence from string as follows. > input: "hello >>1 world >>2" > output: ("hello " [">>1"] " world " [">>2"]) > > What is efficient way to achieve this in ClojureScript? This is a JVM Clojure solution. I'm not sure if ClojureScript has clojure.st

How to convert string into sequence with replacing matched text.

2012-02-12 Thread Takahiro Hozumi
Hi, I want to make a sequence from string as follows. input: "hello >>1 world >>2" output: ("hello " [">>1"] " world " [">>2"]) What is efficient way to achieve this in ClojureScript? Thanks. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post t