Project

General

Profile

Actions

Bug #12394

closed

Regexp#match? should strictly return true or false

Added by sam.saffron (Sam Saffron) almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
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) almost 8 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
Actions #2

Updated by nobu (Nobuyoshi Nakada) almost 8 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]
Actions

Also available in: Atom PDF

Like0
Like0Like0