Issue #8210 has been updated by k_takata (Ken Takata).

File fix-8210-1-update.diff added

> I think -1 is suitable because it looks to keep original intention more than -2.

Thanks for your comment.
I have updated onigmo's tmp/ruby-2.0.x branch.
https://github.com/k-takata/Onigmo/tree/f22cf2e566712cace60d17f84d63119d7c5764ee

I also attach an updated patch so that can be applied to Ruby 1.9.3.
----------------------------------------
Bug #8210: Multibyte character interfering with end-line character within a regex
https://bugs.ruby-lang.org/issues/8210#change-38513

Author: sawa (Tsuyoshi Sawada)
Status: Assigned
Priority: Normal
Assignee: naruse (Yui NARUSE)
Category: M17N
Target version: current: 2.1.0
ruby -v: 2.0


=begin
With this regex:

    regex1 = /\z/

the following strings match as expected:

    "hello" =~ regex1 # => 5
    "????????лу?бу??" =~ regex1 # => 5

but with these regexes:

    regex2 = /#$/?\z/
    regex3 = /\n?\z/

they show difference:

    "hello" =~ regex2 # => 5
    "hello" =~ regex3 # => 5
    "????????лу?бу??" =~ regex2 # => nil
    "????????лу?бу??" =~ regex3 # => nil

The string encoding is UTF-8, and the OS is Linux (i.e., `$/` is `"\n"`). I expect them to behave the same, and believe this is a bug.
=end


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