Project

General

Profile

Actions

Bug #21291

open

possible bug with /m regexp and $ based on input

Added by zenspider (Ryan Davis) 7 days ago. Updated 7 days ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:121757]

Description

reported in discord by the.unnamed user:

#!/usr/bin/env -S ruby -vw
# => ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [arm64-darwin24]

p "a\n" =~ /$./m
# => 1
p "a\n" =~ /$.*/m
# => 1
p "aa\n" =~ /$./m
# => 2
p "aa\n" =~ /$.*/m       # !!!
# => nil
p "aa\n" =~ /$[\S\s]*/m
# => 2

goes back to at least 3.2.8

Updated by nobu (Nobuyoshi Nakada) 7 days ago

1.8 prints 2 but 1.9 and later print nil.

Actions #2

Updated by nobu (Nobuyoshi Nakada) 7 days ago

  • Backport changed from 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN to 3.2: REQUIRED, 3.3: REQUIRED, 3.4: REQUIRED
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0