[Dirvish] pattern matching hash on excludes

Paul Slootman paul at debian.org
Thu Oct 27 07:01:05 PDT 2005


On Thu 27 Oct 2005, Dave Howorth wrote:
> 
> > Otherwise something like this, so that escaping the # would work:
> > 
> >                 if (/\\#/) {
> >                     s/\\#/#/;
> >                 }
> >                 else {
> >                     s/\s*#.*$//;
> >                 }
> 
> I don't think that allows for both \# and # occuring on the same line or
> more than one \#. How about something like:
> 
>   s/^#.*$//;
>   s/\s*[^\\]#.*$//;
>   s/\\#/#/g;

Yes, that looks better.


Paul Slootman


More information about the Dirvish mailing list