I'm not understanding re-find.

(re-find #"bar" "bar") => "bar"

whereas

(re-find #"(foo)|(bar)" "foo bar") => ["foo" "foo" nil]

Why does one return a vector and one just the result directly?

Looking at the code, re-find uses re-groups which explicitly says that
it either returns a vector or a string.  This is clunky to deal with -
is there any reason it doesn't always return a vector?


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