Project

General

Profile

Actions

Bug #5900

closed

RegExp – Newline and \Z Anchor

Added by skalee (Sebastian Skalacki) over 12 years ago. Updated over 12 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]
Backport:
[ruby-core:42154]

Description

/\Aaaa\Z/ =~ "aaa\n"
=> 0 #and should be nil

Same result in MRI 1.9.2.

Updated by naruse (Yui NARUSE) over 12 years ago

  • Status changed from Open to Rejected

It is expected behavior.

See doc/re.rdoc:

  • \Z - Matches end of string. If string ends with a newline,
    it matches just before newline
  • \z - Matches end of string
Actions

Also available in: Atom PDF

Like0
Like0