That works well.

Can you explain to me why

/(.*)?\//

matched the text in front of the "/" AND the "/"

though

?

unknown wrote:
> Hi --
> 
> On Tue, 18 Apr 2006, Wes Gamble wrote:
> 
>>
>> If presented with
>> How can I just get the part of the string before the slash?
> How about:
> 
>    /[^\/]+/   # match one or more non-slash characters
> 
> 
> David
> 
> --
> David A. Black (dblack / wobblini.net)
> Ruby Power and Light, LLC (http://www.rubypowerandlight.com)
> 
> "Ruby for Rails" PDF now on sale!  http://www.manning.com/black
> Paper version coming in early May!


-- 
Posted via http://www.ruby-forum.com/.