Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-18 Thread Kelsey Cummings
al code is most likely better. > Kelsey Cummings wrote: > > > Date: Fri, 15 Mar 2002 10:13:19 -0800 > > From: Kelsey Cummings <[EMAIL PROTECTED]> > > To: Rob McMillin <[EMAIL PROTECTED]> > > Cc: [EMAIL PROTECTED] > > Subject: Re: [SAtalk] SUBJ_A

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-18 Thread Craig R Hughes
AIL PROTECTED] > Subject: Re: [SAtalk] SUBJ_ALL_CAPS regex broken > > On Mon, Mar 11, 2002 at 08:43:09AM -0800, Rob McMillin wrote: > > Matt Sergeant wrote: > > > > > > > >Wouldn't an easier fix be: > > > > > >/^([A-Z]|[^a-z])*$/ > &

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-15 Thread Kelsey Cummings
On Mon, Mar 11, 2002 at 08:43:09AM -0800, Rob McMillin wrote: > Matt Sergeant wrote: > > > > >Wouldn't an easier fix be: > > > >/^([A-Z]|[^a-z])*$/ > > > Interesting. [^a-z] includes [A-Z]. It also matches a zero-length > string. How about > > /^(?:[A-Z]|[^A-Za-z])+$/ Is one of these fixes goi

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-11 Thread Rob McMillin
Theo Van Dinter wrote: >On Mon, Mar 11, 2002 at 02:26:42PM +, Matt Sergeant wrote: > >>I think the original intention of the count was to make sure we had at >>least three upper case chars, in which case you could get away with: >> >>/^([A-Z]|[^a-z])*?[A-Z]{3,}([A-Z]|[^a-z])*$/ >> >>That need

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-11 Thread Matt Sergeant
On Mon, 11 Mar 2002, Theo Van Dinter wrote: > On Mon, Mar 11, 2002 at 02:26:42PM +, Matt Sergeant wrote: > > I think the original intention of the count was to make sure we had at > > least three upper case chars, in which case you could get away with: > > > > /^([A-Z]|[^a-z])*?[A-Z]{3,}([A-Z

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-11 Thread Rob McMillin
Matt Sergeant wrote: > >Wouldn't an easier fix be: > >/^([A-Z]|[^a-z])*$/ > Interesting. [^a-z] includes [A-Z]. It also matches a zero-length string. How about /^(?:[A-Z]|[^A-Za-z])+$/ ??? -- http://www.pricegrabber.com | Dog is my co-pilot.

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-11 Thread Theo Van Dinter
On Mon, Mar 11, 2002 at 02:26:42PM +, Matt Sergeant wrote: > I think the original intention of the count was to make sure we had at > least three upper case chars, in which case you could get away with: > > /^([A-Z]|[^a-z])*?[A-Z]{3,}([A-Z]|[^a-z])*$/ > > That needs testing though to make su

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-11 Thread Charlie Watts
On Mon, 11 Mar 2002, Matt Sergeant wrote: > I think the original intention of the count was to make sure we had at > least three upper case chars, in which case you could get away with: > > /^([A-Z]|[^a-z])*?[A-Z]{3,}([A-Z]|[^a-z])*$/ > > That needs testing though to make sure it doesn't backtrack

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-11 Thread Matt Sergeant
On Mon, 11 Mar 2002, Charlie Watts wrote: > On Mon, 11 Mar 2002, Matt Sergeant wrote: > > > > > > Wouldn't an easier fix be: > > > > /^([A-Z]|[^a-z])*$/ > > That's just way too simple, Matt. Let's try for something more > complicated. :-) > > But it doesn't have the "must have at least XX charac

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-11 Thread Charlie Watts
On Mon, 11 Mar 2002, Matt Sergeant wrote: > > > Wouldn't an easier fix be: > > /^([A-Z]|[^a-z])*$/ That's just way too simple, Matt. Let's try for something more complicated. :-) But it doesn't have the "must have at least XX characters" element that the other test has. Does that matter? I'm no

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-11 Thread Matt Sergeant
On Sun, 10 Mar 2002, Rob McMillin wrote: > Charlie Watts wrote: > > >On Sat, 9 Mar 2002, Rob McMillin wrote: > > > >> > >>s/b > >> > >> return $subject cmp uc($subject); > >> > >> > >> > > > >'s OK, I'll share my prize with you. Everybody goes home a winner here at > >"The Regex is Right!" > > >

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-10 Thread Charlie Watts
On Sun, 10 Mar 2002, Sidney Markowitz wrote: > The following program did not take long to run. What am I doing wrong? > > #!/usr/bin/perl > $string="AAA foofoo"; > if ($string=~/^[^a-z]*([A-Z][^a-z]*){3,}[^a-z]*$/) { > print "passed\n"; > } else { > print "failed\n

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-10 Thread Rob McMillin
Bart Schaefer wrote: >On Sun, 10 Mar 2002, Rob McMillin wrote: > >>+ return !($subject cmp uc($subject)); >> > >Um, why not: > > return ($subject eq uc($subject)) > >?? > Sure, if you like: diff -c /usr/home/rlm/src/RPMS/BUILD/Mail-SpamAssassin/lib/Mail/SpamAssassin/EvalTests.pm.\~1\~ /us

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-10 Thread Bart Schaefer
On Sun, 10 Mar 2002, Rob McMillin wrote: > + return !($subject cmp uc($subject)); Um, why not: return ($subject eq uc($subject)) ?? ___ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-10 Thread Rob McMillin
Sidney Markowitz wrote: >I don't really know perl, but I tried to duplicate the slow match on the >rule in a little test program to see if I could experiment with ideas >for a working regexp. > >The following program did not take long to run. What am I doing wrong? > Probably using a different re

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-10 Thread Sidney Markowitz
I don't really know perl, but I tried to duplicate the slow match on the rule in a little test program to see if I could experiment with ideas for a working regexp. The following program did not take long to run. What am I doing wrong? #!/usr/bin/perl $string="AAA foofoo"; if ($s

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-09 Thread Rob McMillin
Charlie Watts wrote: >On Sat, 9 Mar 2002, Rob McMillin wrote: > >> >>s/b >> >> return $subject cmp uc($subject); >> >> >> > >'s OK, I'll share my prize with you. Everybody goes home a winner here at >"The Regex is Right!" > Okay, so here's my mods: cd ~/src/RPMS/BUILD/Mail-SpamAssassin/lib/Mail/

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-09 Thread Rob McMillin
Charlie Watts wrote: >On Sat, 9 Mar 2002, Rob McMillin wrote: > >> >>s/b >> >> return $subject cmp uc($subject); >> >> >> > >'s OK, I'll share my prize with you. Everybody goes home a winner here at >"The Regex is Right!" > Cool, I was just hoping for a board game version of the show as a consol

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-09 Thread Charlie Watts
On Sat, 9 Mar 2002, Rob McMillin wrote: > > s/b > > return $subject cmp uc($subject); > > 's OK, I'll share my prize with you. Everybody goes home a winner here at "The Regex is Right!" -- Charlie Watts [EMAIL PROTECTED] Frontier Internet, Inc. http://www.frontier.net/ ___

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-09 Thread Rob McMillin
Charlie Watts wrote: >On Sat, 9 Mar 2002, Rob McMillin wrote: > >>Charlie Watts wrote: >> >>>The current SUBJ_ALL_CAPS is broken. >>> >>>(The one from CVS - this: >>>header SUBJ_ALL_CAPS Subject =~ /^[^a-z]*([A-Z][^a-z]*){3,}[^a-z]*$/ >>>) >>> >>Congratulations, Charlie! You're the next winner on

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-09 Thread Charlie Watts
On Sat, 9 Mar 2002, Rob McMillin wrote: > Charlie Watts wrote: > > >The current SUBJ_ALL_CAPS is broken. > > > >(The one from CVS - this: > >header SUBJ_ALL_CAPS Subject =~ /^[^a-z]*([A-Z][^a-z]*){3,}[^a-z]*$/ > >) > > > Congratulations, Charlie! You're the next winner on "The Regex Is Right!" T

Re: [SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-09 Thread Rob McMillin
Charlie Watts wrote: >The current SUBJ_ALL_CAPS is broken. > >(The one from CVS - this: >header SUBJ_ALL_CAPS Subject =~ /^[^a-z]*([A-Z][^a-z]*){3,}[^a-z]*$/ >) > Congratulations, Charlie! You're the next winner on "The Regex Is Right!" Heh. The problem is that this RE has exponential backoff t

[SAtalk] SUBJ_ALL_CAPS regex broken

2002-03-09 Thread Charlie Watts
The current SUBJ_ALL_CAPS is broken. (The one from CVS - this: header SUBJ_ALL_CAPS Subject =~ /^[^a-z]*([A-Z][^a-z]*){3,}[^a-z]*$/ ) Scanning this message takes 10 seconds: From: Charlie Watts <[EMAIL PROTECTED]> Subject: A foofoo token body This takes 20 seconds: From: C