From: Paolo Bonzini Date: Wed, 28 Feb 2007 15:14:15 GMT Subject: Re: git-remote and remotes with '.' in their names Message-ID: <45E59C47.9000001@lu.unisi.ch> In-Reply-To: Johannes Schindelin wrote: > Hi, > > On Wed, 28 Feb 2007, Paolo Bonzini wrote: > >> Hello, >> >>> for (@remotes) { >>> - if (/^remote\.([^.]*)\.(\S*)\s+(.*)$/) { >>> + if (/^remote\.(.*)\.(\S*)\s+(.*)$/) { >> You probably want either >> >> + if (/^remote\.(\S*)\.(\S*)\s+(.*)$/) { >> >> or >> >> + if (/^remote\.(\S*)\.([^.]*)\s+(.*)$/) { > > Did you mean to prevent the remote starting with a dot? IMHO that would be > a good change, but AFAIS both your proposals don't do that. No, I meant to avoid the ".*" in Paul's proposal. They should be in practice equivalent but, with the second one, I made the regex more readable: it is clearer that the $3 variable is not meant to include dots. Your proposal makes sense to me -- that would be + if (/^remote\.([^.]\S*)\.([^.]*)\s+(.*)$/) { Paolo