1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/language/regexp
Jeremy Evans 11ae581a4a Fix handling of control/meta escapes in literal regexps
Ruby uses a recursive algorithm for handling control/meta escapes
in strings (read_escape).  However, the equivalent code for regexps
(tokadd_escape) in did not use a recursive algorithm.  Due to this,
Handling of control/meta escapes in regexp did not have the same
behavior as in strings, leading to behavior such as the following
returning nil:

```ruby
/\c\xFF/ =~ "\c\xFF"
```

Switch the code for handling \c, \C and \M in literal regexps to
use the same code as for strings (read_escape), to keep behavior
consistent between the two.

Fixes [Bug #14367]
2021-05-12 18:55:43 -07:00
..
anchors_spec.rb
back-references_spec.rb
character_classes_spec.rb
empty_checks_spec.rb
encoding_spec.rb
escapes_spec.rb
grouping_spec.rb
interpolation_spec.rb Fix handling of control/meta escapes in literal regexps 2021-05-12 18:55:43 -07:00
modifiers_spec.rb
repetition_spec.rb
subexpression_call_spec.rb