Why does this regex not work in #jruby when it works fine in #ruby?
<Symbol>: /^[\p{Symbol}]+$/
Error "invalid character property name"
JRuby uses the Joni Regexp
library, which is a hand-written line-by-line C-to-Java port of the Onigmo Regexp
library used by YARV and Rubinius.
Actually, the story is not quite so simple.
First, there was a Regexp
library called Oniguruma. This library was then imported into the YARV sourcetree, and thus effectively forked. The YARV developers added features to their own fork, some of which got merged back into Oniguruma proper, some didn't. The Oniguruma developers added features, some of which got merged into the YARV fork, some didn't.
At some point during that time, the JRuby developers gave up trying to support Ruby semantics on top of Java regexes, and did a line-by-line translation of Oniguruma from C to Java. The resulting library is called Joni. Of course, Oniguruma and its YARV fork continue being developed, and the Joni developers have to try and track that development.
Fast forward a couple of years, another fork of Oniguruma is created, called Onigmo, which forks the latest version of Oniguruma and adds many of the features that were added by the YARV developers. The YARV developers throw out their own fork of Oniguruma and instead import their own fork of Onigmo.
And Joni has to try and keep up with all of that.
In short: it's probably a bug: sometime, somewhere, something got lost, mis-translated, or is just plain buggy. It happens.
You should file a bug either against JRuby or Joni, or both.