# \[Bug #2374\] URI.regexp('http') $B$,(B 'http://' $B$K%^%C%A$9$k(B

**URL:** <https://www.ruby-forum.com/t/bug-2374-uri-regexp-http-b-b-http-b-k-c-a-9-k-b/179032>\
**Category:** Development\
**Created:** [November 16, 2009, 5:34am UTC](https://www.ruby-forum.com/t/bug-2374-uri-regexp-http-b-b-http-b-k-c-a-9-k-b/179032 "2009-11-16T05:34:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kouhei\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/bcef8e/32.png) [@Kouhei\_Y](https://www.ruby-forum.com/u/Kouhei_Y)\
**Post date:** [November 16, 2009, 5:34am UTC](https://www.ruby-forum.com/t/bug-2374-uri-regexp-http-b-b-http-b-k-c-a-9-k-b/179032/1 "2009-11-16T05:34:58Z")

</div>

Bug #2374: URI.regexp(‘http’) e$B$,e(B ‘http://’ e$B$K%^%C%A$9$ke(B  
[http://redmine.ruby-lang.org/issues/show/2374](http://redmine.ruby-lang.org/issues/show/2374)

e$B5/I\<\<Te(B: Kouhei Y.  
e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal  
e$B%+%F%4%je(B: lib  
ruby -v: ruby 1.9.2dev (2009-11-16 trunk 25792) [i686-linux]

URI.regexp(‘http’) e$B$,e(B ‘http://’ e$B$K%^%C%A$7$^$9$,!“e(B’http://’  
e$B$OM-8z$Je(B URI e$B$G$O$”$j$^$;$s!#e(B

% ~/local/ruby-trunk/bin/ruby -v -ruri -e ‘URI.regexp =~ “http://”; p  
$&’  
ruby 1.9.2dev (2009-11-16 trunk 25792) [i686-linux]  
“http://”

[http://www.ietf.org/rfc/rfc3986](http://www.ietf.org/rfc/rfc3986) [Page 20]

If the URI scheme defines a default for host, then that default  
applies when the host subcomponent is undefined or when the  
registered name is empty (zero length). For example, the “file” URI  
scheme is defined so that no authority, an empty host, and  
“localhost” all mean the end-user’s machine, whereas the “http”  
scheme considers a missing authority or empty host invalid.
