From: merch-redmine@... Date: 2021-06-17T19:29:36+00:00 Subject: [ruby-core:104353] [Ruby master Bug#14137] Windows / MinGW - Regexp - Character Properties - General Category Issue #14137 has been updated by jeremyevans0 (Jeremy Evans). Status changed from Open to Closed I tested this using RubyInstaller versions on Windows. This appears related to regexp encoding, and not a bug, with the same behavior between Ruby 2.0 and 3.0: ``` C:\>c:\Ruby30-x64\bin\ruby -e "p(/\p{L}/.match('a'))" -e:1: invalid character property name {L}: /\p{L}/ C:\>c:\Ruby30-x64\bin\ruby -e "p(/\p{L}/u.match('a'))" # C:\>c:\Ruby30-x64\bin\ruby -Ku -e "p(/\p{L}/.match('a'))" # C:\>c:\Ruby200-x64\bin\ruby -e "p(/\p{L}/.match('a'))" -e:1: invalid character property name {L}: /\p{L}/ C:\>c:\Ruby200-x64\bin\ruby -e "p(/\p{L}/u.match('a'))" # C:\>c:\Ruby200-x64\bin\ruby -Ku -e "p(/\p{L}/.match('a'))" # ``` The documentation for this feature (https://docs.ruby-lang.org/en/master/doc/regexp_rdoc.html#label-Character+Properties) says: `A Unicode character's General Category value can also be matched`, which I think implies this should only work for Unicode regexps, and not other regexps. So I think the current behavior is expected and not a bug. ---------------------------------------- Bug #14137: Windows / MinGW - Regexp - Character Properties - General Category https://bugs.ruby-lang.org/issues/14137#change-92580 * Author: MSP-Greg (Greg L) * Status: Closed * Priority: Normal * ruby -v: ruby 2.5.0dev (2017-11-28 trunk 60925) [x64-mingw32] * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- While testing RDoc on Appveyor, and the recently 'added' literals.kpeg file, I had several errors across Ruby versions 2.2 thru trunk. It seems that the `\p{}` constructs listed [here](https://msp-greg.github.io/ruby_trunk/file.regexp.html#label-Character+Properties) under 'General Category' generate an `invalid character property name {**}` error for many of the listed constructs. Conversely, the constructs listed previously (eg \p{Alpha}, \p{Lower}, \p{Space}, etc) seem to work. I briefly looked at the regexp tests, and they don't seem to test these. Are these unavailable on Windows? -- https://bugs.ruby-lang.org/ Unsubscribe: