ClojureScript

(str regex) behaves differently from clojure.

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

In JVM clojure:
(str #"\d+") =>"
d+"

In clojurescript:
(str #"\d+") => "/
/d+/"

Activity

Hide
Russell Mull added a comment -

The above got mangled by markdown; basically, the clojurescript version has slashes around it.

Show
Russell Mull added a comment - The above got mangled by markdown; basically, the clojurescript version has slashes around it.
Hide
David Nolen added a comment -

we're not going to try to resolve host regular expression difference like this.

Show
David Nolen added a comment - we're not going to try to resolve host regular expression difference like this.
Hide
Russell Mull added a comment -

It might be worth considering an exception here. The use case I have in mind is: in a parser, you often want to prepend a ^ to the regular expression provided by a library user.

It's easy enough to work around though, so it's not a big deal.

Show
Russell Mull added a comment - It might be worth considering an exception here. The use case I have in mind is: in a parser, you often want to prepend a ^ to the regular expression provided by a library user. It's easy enough to work around though, so it's not a big deal.
Hide
Jozef Wagner added a comment -

It would be nice for (re-pattern (str regex))) to return an equivalent regex (even though = on regexes compares identity)

Show
Jozef Wagner added a comment - It would be nice for (re-pattern (str regex))) to return an equivalent regex (even though = on regexes compares identity)

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: