Actions
Bug #21291
openpossible bug with /m regexp and $ based on input
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
Actions
Like0
Like0Like0Like0