Welcome! Please see the About page for a little more info on how this works.

0 votes
ago in ClojureScript by

In Clojure, the following expression works fine:

(re-matches #"\p{Lu}" "Á") ;; => "Á"

But in Clojurescript, it returns nil.

It is not that Javascript doesn't support that kind of Unicode classess, but you have to activate them explicitly, whether in Java, they are activated by default.

E.g. In Javascript, the following code returns true:

/\p{Lu}/u.test("Á") // => true

But if I omit the Unicode flag (/u) I get false:

/\p{Lu}/.test("Á") // => false

I think this is probably because Clojure Script doesn't activates the Unicode flag for us.

If that the case, I think consistency between Clojurescript and Clojure could benefit a lot if the flag is activated by default.

Please log in or register to answer this question.

...