matz (Yukihiro Matsumoto) wrote in #note-68: > I admit `Symbol#name` that returns a frozen string from a symbol. This can be a building block of the proposal. > ... For what it's worth, I agree with the above suggestion to try making a...tom-lord (Tom Lord)
Here's a slightly more minimal reproduction example: ~~~ ruby "abb".match /(?~(a)c)/ #=> ArgumentError: negative string size (or size too big) ~~~ My best guess is that the regexp engine is caught in an unexpected state, where t...tom-lord (Tom Lord)
The new absent/absence regex operator, added to Onigmo and bundled into ruby since v2.4.1, supports nested groupings such as: ~~~ruby "abb".match /(?~(a|b)b)/ => #<MatchData "a" 1:"a"> ~~~ However, under some scenarios (I haven...tom-lord (Tom Lord)
Consider the following: ~~~ ruby def get_method(sym, object = Object) object.send(:method, sym) end ~~~ This allows us to write code like: ~~~ ruby [1, 4, 9].map &get_method(:sqrt, Math) ~~~ So as an idea, how abo...tom-lord (Tom Lord)
On further investigation, this is a known issue in Onigmo (Ruby 2.x's regexp parser). However, it was apparently "fixed" way back in 2006: https://github.com/k-takata/Onigmo/blob/d0b3173893b9499a4e53ae1da16ba76c06d85571/HISTORY#L584-5...tom-lord (Tom Lord)
Nobuyoshi Nakada wrote: > It occurs with UTF-8 encoding only. Ahhhhh, of course - *that's* what the difference between `60.chr` and `"<"` is! Like you said, the issue only affects UTF-8 encodings: #<Encoding:UTF-8>, #<Encod...tom-lord (Tom Lord)
Documented non-subexp option toggling Regexp option toggling can be done in two forms: /(?imx:subexpr)/ - this was already mentioned in docs /before(?imx)after/ - there was no mention of this. This section of the documentation ...tom-lord (Tom Lord)