From: shugo@... Date: 2017-01-18T02:53:23+00:00 Subject: [ruby-core:79110] [Ruby trunk Bug#13135] Regexp.last_match returns nil with s.rindex(//) Issue #13135 has been reported by Shugo Maeda. ---------------------------------------- Bug #13135: Regexp.last_match returns nil with s.rindex(//) https://bugs.ruby-lang.org/issues/13135 * Author: Shugo Maeda * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- Regexp.last_match returns nil, if // is given to String#rindex: ``` lexington:ruby$ ruby -ve 'p "foo".rindex(//); p Regexp.last_match' ruby 2.5.0dev (2017-01-17 trunk 57359) [x86_64-linux] 3 nil ``` while it returns a MatchData with String#index: ``` lexington:ruby$ ruby -ve 'p "foo".index(//); p Regexp.last_match' ruby 2.5.0dev (2017-01-17 trunk 57359) [x86_64-linux] 0 # ``` Is this intended behavior? -- https://bugs.ruby-lang.org/ Unsubscribe: