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

Re: colours and quotes and regex libs? (was: Re: colours and quotes)



On Fri, May 28, 2004 at 04:03:06PM EDT, Ronald J Kimball wrote:
> On Fri, May 28, 2004 at 09:04:00PM +0200, Nicolas Rachinsky wrote:
> > * David Yitzchak Cohen <lists+mutt_users@xxxxxxxxxxxxxx> [2004-05-28 14:29 
> > -0400]:

> Here's a mutt-friendly regex, based on David's Perl regex, that seems to do
> well:
> 
> color body brightblue default \
>   '(https?|ftp|gopher|finger):\/\/([^"'"'"' \t\n)>.,!?&]|[.,!?][^"'"'"' 
> \t\n)>.,!?&]|&([^g]|$)|&g([^t]|$)|&gt([^;]|$))+'
> 
> (Watch out for line-wrapping.  There's a space character before each \t.)
> 
> The URL can't contain ["' \t\n)>].
> The URL can contain [.,!?], but only when not followed by ["' \t\n)>.,!?&].
> The URL can contain &, but only when not followed by gt;.

Wow!

> P.S.  Here are some examples that the regex colors properly.
> 
> http://www.example.com
> <http://www.example.com>
> "http://www.example.com";
> 'http://www.example.com'
> http://www.example.com/?f=1&g=2
> http://www.example.com/?foo&;
> http://www.example.com/?f&g
> &lt;http://www.example.com/?foo&bar&gt;
> Have you seen http://www.example.com?  It's great!
> Go to http://www.example.com...
> Try http://www.example.com, I think you'll like it.
> He said, "Check out http://www.example.com.";

A few of these don't work properly with my regex ... no fun ... I guess
I need to go back and Perl up some more fun stuff ;-)

(Hey, you've gotta admit my regex is _far_ simpler than THAT ugly thing,
even if it does a bit less.)

Regardless, the fact that two people can confirm that partial line
coloring works fine in modern Mutts is enough.  I'm gonna have to change
my WHY_USE [1] to toss that comment.

Thanks a bunch,
 - Dave

[1]
http://www.bigfatdave.com/dave/mutt/muttdir/WHY_USE

-- 
Uncle Cosmo, why do they call this a word processor?
It's simple, Skyler.  You've seen what food processors do to food, right?

Please visit this link:
http://rotter.net/israel

Attachment: pgpjqbJI4FM3y.pgp
Description: PGP signature