Does multibyte character interfere with end-line character within a regex?

前端 未结 2 1887
孤街浪徒
孤街浪徒 2021-02-05 12:12

With this regex:

regex1 = /\\z/

the following strings match:

\"hello\" =~ regex1 # => 5
\"こんにちは\" =~ regex1 # => 5
         


        
2条回答
  •  清歌不尽
    2021-02-05 12:22

    In Ruby trunk, the issue has now been accepted as a bug. Hopefully, it will be fixed.

    Update: Two patches have been posted in Ruby trunk.

提交回复
热议问题