Project

General

Profile

Bug #12394

Regexp#match? should strictly return true or false

Added by sam.saffron (Sam Saffron) about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:75604]

Description

Now:

//.match?"" #=> nil
/a/.match?"" #=> nil

Should be:

//.match?"" #=> true
/a/.match?"" #=> false

Updated by nobu (Nobuyoshi Nakada) about 4 years ago

  • Description updated (diff)
  • Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONTNEED
#2

Updated by nobu (Nobuyoshi Nakada) about 4 years ago

  • Status changed from Open to Closed

Applied in changeset r55069.


re.c: fix match?

  • re.c (rb_reg_match_m_p): fix match against empty string. rb_str_offset returns the end when the position exceeds the length. fix the range parameter of onig_search. [ruby-core:75604] [Bug #12394]

Also available in: Atom PDF