From: "jjyr (jy j)" Date: 2013-08-28T17:25:39+09:00 Subject: [ruby-core:56845] [ruby-trunk - Bug #8828][Open] regex matching not correct Issue #8828 has been reported by jjyr (jy j). ---------------------------------------- Bug #8828: regex matching not correct https://bugs.ruby-lang.org/issues/8828 Author: jjyr (jy j) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: 2.0.0-p247 Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN str = " [1]: http://google.com/ "Google"" str =~ /\A\s*\[(.+)\]\:\ (\S+)\s*((?<=").+(?="))/ #=> nil #then i replace this part '(?<=").+(?=")' with '.+' str =~ /\A\s*\[(.+)\]\:\ (\S+)\s*(.+)/ #=> 0 $3 #=> ""Google"" $3 =~ /((?<=").+(?="))/ #=> 6 $1 # => "Google" it can matching now! but i just replace a part of regex with .+, then retry the part, it should not matching? (or it should work at beginning) -- http://bugs.ruby-lang.org/