Skip to content

Regexp#=== does not capture groups #6883

@0x1eef

Description

@0x1eef

Hello

Is it possible to be compat with CRuby here? Thanks.

bug.rb

command = "search-user-handbook"
case command
when /search-(user)-handbook/
  p $1
end

CRuby

robert@code:~/projects/robert $ ruby -v bug.rb 
ruby 4.0.3 (2026-04-21 revision 85ddef263a) +PRISM [x86_64-freebsd15.1]
"user"

mruby (735b945)

robert@code:~/projects/robert $ ./bin/mruby bug.rb 
nil

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions