From: Wes Gamble Date: 2006-04-18T00:39:13+09:00 Subject: Regular expression to parse out "host" part of URL string All, I am trying to write a regex to parse out the "host" part of a potential URL. So if presented with www.cnn.com I want to get www.cnn.com If presented with www.cnn.com/ I want to get www.cnn.com If presented with www.cnn.com/some/other/stuff I want to get www.cnn.com This regex: /(.*)?\/*/ matches everything This regex: /(.*)?\// matches everything including the "/" How can I just get the part of the string before the slash? Thanks, Wes -- Posted via http://www.ruby-forum.com/.