Ah, thanks, I forgot about the word-boundary regex, but unfortunately, the regex I want to split on is more complicated than #"\s+"—I just used #"\s+" as an example, and I don't think #"\b" will work in this case.
On May 13, 1:26 pm, Drew Raines <aarai...@gmail.com> wrote: > You could do it by using the word boundary regexp operator. > > (ns foo.bar > (:use [clojure.contrib.string :only [split]])) > > (defn split* [s] > (drop 1 (split #"\b" s))) > > (split* "ab c de") > > ;; ("ab" " " "c" " " "de") > > -Drew > > On Thu, May 13, 2010 at 11:24, joshua-choi <rbysam...@gmail.com> wrote: > > I'd like to know if there's a standard function similar to > > clojure.contrib.string/split that includes the characters between the > > spitted string, or if there isn't one, how I might write one. In other > > words, I'd like a function split* such that (split* #"\s+" "ab c de") > > returns ("ab" " " "c" " " "de"). > > > -- > > 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 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 > athttp://groups.google.com/group/clojure?hl=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