<<< Date Index >>>     <<< Thread Index >>>

Re: highlighting urls ???



Gary Johnson <garyjohn@xxxxxxxxxxxxxxx> [2004:01:10:11:13:42-0800] scribed:
> On 2004-01-10, Michael D Schleif <mds@xxxxxxxxxxx> wrote:
> > Gary Johnson <garyjohn@xxxxxxxxxxxxxxx> [2004:01:10:10:32:30-0800] scribed:
> 
> > > So for your simple example, I think this will work:
> > > 
> > >   color body brightred default [][a-zA-Z0-9]+
> > 
> > OK, bizarre as it is, that color command works.
> > 
> > However, the following:
> > 
> >    color body brightblue default 
> > (https?|ftp)://[][\-\.\,\;=/%~_:?\#a-zA-Z0-9&+]+
> > 
> > produces the following mutt startup error:
> > 
> >    Error in /home/mds/.muttrc, line 500: Invalid range end
> >    source: errors in /home/mds/.muttrc
> > 
> > And, the following:
> > 
> >    color body brightblue default 
> > (https?|ftp)://[][\.\,\;=/%~_:?\#a-zA-Z0-9&+-]+
> > 
> > produces the following mutt startup error:
> > 
> >    Error in /home/mds/.muttrc, line 500: Unmatched [ or [^
> >    source: errors in /home/mds/.muttrc
> > 
> > What am I missing?
> 
> I don't know for sure.  To be honest, getting any mutt regular
> expression to work is often a matter of trial and error for me.  I
> usually surround them with single quotes, though, and doing so has
> solved a lot of problems for me before.  I just tried executing your
> second example,
> 
>     color body brightblue default 
> (https?|ftp)://[][\.\,\;=/%~_:?\#a-zA-Z0-9&+-]+
> 
> at the command line and did get an error.  Then I edited it to add
> the single quotes,
> 
>     color body brightblue default 
> '(https?|ftp)://[][\.\,\;=/%~_:?\#a-zA-Z0-9&+-]+'
> 
> and mutt accepted it.  Further, the URLs in the one message I opened
> appeared to be colored correctly.
> 
> My 5-seconds-of-thought guess is that without the quotes, the ';'
> was interpreted by mutt as the end of the color command.

Yes, the single-quotes surrounding the regexp appear to do the trick.
Thank you.

-- 
Best Regards,

mds
mds resource
877.596.8237
-
Dare to fix things before they break . . .
-
Our capacity for understanding is inversely proportional to how much
we think we know.  The more I know, the more I know I don't know . . .
--

Attachment: pgpzfcY3onESr.pgp
Description: PGP signature