ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:53101] [ruby-trunk - Bug #8001][Open] 2.0 Regexp \Z matches where it shouldn't
@ 2013-03-02  9:46 josh.cheek (Josh Cheek)
  2013-03-02  9:49 ` [ruby-core:53102] [ruby-trunk - Bug #8001] " josh.cheek (Josh Cheek)
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: josh.cheek (Josh Cheek) @ 2013-03-02  9:46 UTC (permalink / raw
  To: ruby-core


Issue #8001 has been reported by josh.cheek (Josh Cheek).

----------------------------------------
Bug #8001: 2.0 Regexp \Z matches where it shouldn't
https://bugs.ruby-lang.org/issues/8001

Author: josh.cheek (Josh Cheek)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.2.0]


(({for ruby in ~/.rbenv/versions/{1.9.3-p327,2.0.0-p0}/bin/ruby
do
  "$ruby" -v
  "$ruby" -e 'p /x.*?\Z$/ =~ "x\ny"'
done
}))

In Ruby 1.9: nil
In Ruby 2.0: 0

If you remove the "y" from the string, or add more, then they do the same thing.
The temporary solution I'm using to get around this is to replace `\Z` with `\n\z`



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:53102] [ruby-trunk - Bug #8001] 2.0 Regexp \Z matches where it shouldn't
  2013-03-02  9:46 [ruby-core:53101] [ruby-trunk - Bug #8001][Open] 2.0 Regexp \Z matches where it shouldn't josh.cheek (Josh Cheek)
@ 2013-03-02  9:49 ` josh.cheek (Josh Cheek)
  2013-03-02 12:22 ` [ruby-core:53105] " josh.cheek (Josh Cheek)
  2013-03-03  8:11 ` [ruby-core:53115] " nobu (Nobuyoshi Nakada)
  2 siblings, 0 replies; 4+ messages in thread
From: josh.cheek (Josh Cheek) @ 2013-03-02  9:49 UTC (permalink / raw
  To: ruby-core


Issue #8001 has been updated by josh.cheek (Josh Cheek).


Pasted version from 1.9, here is my actual output with both versions:

ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.2.0]
nil
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.0]
0
----------------------------------------
Bug #8001: 2.0 Regexp \Z matches where it shouldn't
https://bugs.ruby-lang.org/issues/8001#change-37250

Author: josh.cheek (Josh Cheek)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.2.0]


(({for ruby in ~/.rbenv/versions/{1.9.3-p327,2.0.0-p0}/bin/ruby
do
  "$ruby" -v
  "$ruby" -e 'p /x.*?\Z$/ =~ "x\ny"'
done
}))

In Ruby 1.9: nil
In Ruby 2.0: 0

If you remove the "y" from the string, or add more, then they do the same thing.
The temporary solution I'm using to get around this is to replace `\Z` with `\n\z`



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:53105] [ruby-trunk - Bug #8001] 2.0 Regexp \Z matches where it shouldn't
  2013-03-02  9:46 [ruby-core:53101] [ruby-trunk - Bug #8001][Open] 2.0 Regexp \Z matches where it shouldn't josh.cheek (Josh Cheek)
  2013-03-02  9:49 ` [ruby-core:53102] [ruby-trunk - Bug #8001] " josh.cheek (Josh Cheek)
@ 2013-03-02 12:22 ` josh.cheek (Josh Cheek)
  2013-03-03  8:11 ` [ruby-core:53115] " nobu (Nobuyoshi Nakada)
  2 siblings, 0 replies; 4+ messages in thread
From: josh.cheek (Josh Cheek) @ 2013-03-02 12:22 UTC (permalink / raw
  To: ruby-core


Issue #8001 has been updated by josh.cheek (Josh Cheek).


Also realized the regex here ends with \Z$, but can be shown with just \Z.

Here is an updated example:

ruby1.9 -v
  # >> ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.2.0]
ruby2 -v
  # >> ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.0]

ruby1.9 -e 'p /x.*?\Z/ =~ "x\ny"'
  # >> nil
ruby2 -e 'p /x.*?\Z/ =~ "x\ny"'
  # >> 0
----------------------------------------
Bug #8001: 2.0 Regexp \Z matches where it shouldn't
https://bugs.ruby-lang.org/issues/8001#change-37252

Author: josh.cheek (Josh Cheek)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.2.0]


(({for ruby in ~/.rbenv/versions/{1.9.3-p327,2.0.0-p0}/bin/ruby
do
  "$ruby" -v
  "$ruby" -e 'p /x.*?\Z$/ =~ "x\ny"'
done
}))

In Ruby 1.9: nil
In Ruby 2.0: 0

If you remove the "y" from the string, or add more, then they do the same thing.
The temporary solution I'm using to get around this is to replace `\Z` with `\n\z`



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:53115] [ruby-trunk - Bug #8001] 2.0 Regexp \Z matches where it shouldn't
  2013-03-02  9:46 [ruby-core:53101] [ruby-trunk - Bug #8001][Open] 2.0 Regexp \Z matches where it shouldn't josh.cheek (Josh Cheek)
  2013-03-02  9:49 ` [ruby-core:53102] [ruby-trunk - Bug #8001] " josh.cheek (Josh Cheek)
  2013-03-02 12:22 ` [ruby-core:53105] " josh.cheek (Josh Cheek)
@ 2013-03-03  8:11 ` nobu (Nobuyoshi Nakada)
  2 siblings, 0 replies; 4+ messages in thread
From: nobu (Nobuyoshi Nakada) @ 2013-03-03  8:11 UTC (permalink / raw
  To: ruby-core


Issue #8001 has been updated by nobu (Nobuyoshi Nakada).

Description updated


----------------------------------------
Bug #8001: 2.0 Regexp \Z matches where it shouldn't
https://bugs.ruby-lang.org/issues/8001#change-37272

Author: josh.cheek (Josh Cheek)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.2.0]


=begin
 for ruby in ~/.rbenv/versions/{1.9.3-p327,2.0.0-p0}/bin/ruby
 do
   "$ruby" -v
   "$ruby" -e 'p /x.*?\Z$/ =~ "x\ny"'
 done

:In Ruby 1.9: (({nil}))
:In Ruby 2.0: (({0}))

If you remove the "y" from the string, or add more, then they do the same thing.
The temporary solution I'm using to get around this is to replace `(({\Z}))` with `(({\n\z}))`
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-03  8:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-02  9:46 [ruby-core:53101] [ruby-trunk - Bug #8001][Open] 2.0 Regexp \Z matches where it shouldn't josh.cheek (Josh Cheek)
2013-03-02  9:49 ` [ruby-core:53102] [ruby-trunk - Bug #8001] " josh.cheek (Josh Cheek)
2013-03-02 12:22 ` [ruby-core:53105] " josh.cheek (Josh Cheek)
2013-03-03  8:11 ` [ruby-core:53115] " nobu (Nobuyoshi Nakada)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).