I'm just starting with ClojureScript and I've noticed a couple odd 
behaviors with regular expressions, which I assume are bugs.

The first has to do with non-greedy (reluctant) quantifiers. The following 
regexes work fine:

ClojureScript:cljs.user> (re-matches #"a?b?" "a")
"a"
ClojureScript:cljs.user> (re-matches #"a?b?" "b")
"b"

as does this:

ClojureScript:cljs.user> (re-matches #"a??b?" "b")
"b"

but the following doesn't:

ClojureScript:cljs.user> (re-matches #"a??b?" "a")
nil

It does work in regular Clojure:

user=> (re-matches #"a??b?" "a")
"a"

I understand that Clojure uses Java regexes and ClojureScript uses 
JavaScript regexes. I've never really used JavaScript, but my understanding 
is that it supports non-greedy quantifiers.

The other issue is that re-seq in ClojureScript hangs on certain inputs:

ClojureScript:cljs.user> (re-seq #"a?" "a")
<no response>

Thanks,
David

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