From: "zheka (Eugene Mirkin)" Date: 2012-06-01T01:33:28+09:00 Subject: [ruby-core:45344] [ruby-trunk - Bug #6520][Open] Invalid url is identified as valid Issue #6520 has been reported by zheka (Eugene Mirkin). ---------------------------------------- Bug #6520: Invalid url is identified as valid https://bugs.ruby-lang.org/issues/6520 Author: zheka (Eugene Mirkin) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: 1.9.3p125 (({ 1.9.3p125 :006 > require 'uri' => true 1.9.3p125 :007 > URI.parse invalid_url URI::InvalidURIError: bad URI(is not URI?): http://abc invalid_url =~ URI::regexp => 0 })) As you can see, 'parse' behaves correctly (ie raises an exception), while the 'regexp' does not catch the error -- http://bugs.ruby-lang.org/