* Prahlad Vaidyanathan ([EMAIL PROTECTED]) wrote:

> On Fri, 30 Nov 2001 Thomas <[EMAIL PROTECTED]> spewed into the ether:
> [-- snip --]
> > Initial perl version at:
> > 
> > http://freak.aagh.net/code/quotefix.pl
> 
> Does this grok "^http:" and stuff ? Doesn't seem to do it here.

It should do, the ruby one certainly seems to, but the Perl version's
poorly tested.

You'll note the:

&& $1.$' !~ /^(>From|(http|mailto|ftp|telnet|gopher|scp|rsync):|[:;]-?\))/)

The ^ is probably tripping it up - maybe a \s* is needed.

> So, what I did was, I converted the regexp it looks for into the
> $quote_regexp in my .muttrc, with a few changes.
>
> <snip> while ($line =~ /^(-->)|^([ \t]*[(A-Z){0,2}|(a-z){0,6}]+>)|^([
> \t\"]*[|>}%])+/ </snip>

I'll see what I can rip out of that, but don't forget >FO

> Another thing is, the "Super-quotes", like "^ AA>", always seem to end
> in ">", and not in "[|}%]", etc. This could possible be changed by
> some sadistic people, but for now, I've omitted everything but ">".

Yeah, something worth exploiting, probably.

> Also, this is something that comes up often in display filtering :
>
> When stripping of trailing white-spaces, don't strip off the
> white-space after the sig-dashes. Or, better yet, do this, before
> printing $line :
>
> $line =~ s/^--$/-- /;

It's made with filtering individual blocks in mind, because this is how
I format mail - I hit F2 to fix the quotes and F3 to run it through par,
but I'll fix this.

> Anyway, great work ! But, unfortunately, the quest for the perfect
> quote_regexp seems never-ending :-(

47 downloads so far - 30 for the quick perl version and 17 for the
original tested Ruby :)

-- 
Thomas 'Freaky' Hurst  -  [EMAIL PROTECTED]  -  http://www.aagh.net/

Reply via email to