-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regex {Ps} symbol not supported #4360
Comments
~ rvm use jruby-1.7.26
Using /Users/olle/.rvm/gems/jruby-1.7.26 Then I tried using the character properties one by one: the first one worked. (Update: this was a red herring. The wrong path to understand this.)
|
@abelsromero Can you check if adding |
(I was able to use the Hiragana character group without failing in a this small program: # encoding: utf-8
if "~" =~ /(\p{Hiragana})+$/
puts "match"
end Calling it:
No output, since my non-hiragana string didn't match. But no error either. The program fails with the error when I had no encoding marker at the first line. |
👍 worked perfectly on JRuby 1.7.26, 9.0.5.0 and native Ruby 2.3.1! Thanks a lot @olleolleolle. |
@abelsromero I was about to say I don't know, and then I ran a search for "encoding" in the wiki of this repo, and found - https://github.com/jruby/jruby/wiki/JRubyCommandLineParameters Where the word comes up. Can you try a few of those? |
Thanks for the tip, really, but I since I am invoking jRuby through maven and a third Java API I'd need to promote those changes to a few layers. I also checked this https://github.com/jruby/jruby/wiki/ConfiguringJRuby, but needs users to set up the file locally :/ Luckily, you saw there's a patch on the go, so probably everything will be fixed soon :) |
@abelsromero Thanks for checking! |
Environment
Expected Behavior
The Ruby core documentation mentions support for \p{Ps} construct in 1.9.2 (https://ruby-doc.org/core-1.9.2/Regexp.html).
Since jRuby 1.7.x aims compatibility with Ruby 1.9.3 I would assume this construct is supported.
Note that in v 9.0.5.0 supports it.
Actual Behavior
However, when I run a this https://github.com/chloerei/asciidoctor-pdf-cjk/blob/v0.1.2/lib/asciidoctor/pdf/cjk.rb, I get the exception
(RegexpError) invalid character property name <Ps>: /(?<!^|\p{Space}|\p{Ps}|\p{Pi})[\p{Han}\p{Hiragana}\p{Katakana}\p{Ps}\p{Pi}]/
I guess this is similar case as in #3603.
The text was updated successfully, but these errors were encountered: