On Wednesday 26 September 2007, Sean Dague wrote:
> On Wed, Sep 26, 2007 at 03:15:51PM -0400, Garrison Hoffman wrote:
> > I filter my mail based on List-Id, is there a reason it keeps changing
> > for this list? Can I at least (based on the three versions I've seen) be
> > reasonably certain that /List-Id: .* <mhvlug\.mhvlug\.org>/ will
> > match?

   Yeah I ran into this too.  I filter on the List-Id header instead of 
Subject so that I wouldn't mistake when someone sent me a private reply vs a 
reply to the list.


On Wednesday 26 September 2007, Jay Gagnon wrote:
> On 9/26/07, Garrison Hoffman <[EMAIL PROTECTED]> wrote:
> > Sean Dague wrote:
> > > Yep, match on List-Id:.*mhvlug.mhvlug.org
> >
> > I'm not certain if regex specificity is an occupational hazard or a
> > personality disorder; I guess I'll live with the greedy match.
>
> I've worked with regular expressions just enough to not understand
> something here.  You say you'll live with the greedy match, which implies
> you want to be able to do better, but that looks like a pretty simple regex
> to me, so I'm not sure what about it isn't up to snuff.

   *mhvlug.mhvlug.org  vs  *mhvlug\.mhvlug\.org  was the only thing I noticed.  
Realistically either will work, although the latter is a little more 
specific.  ["." itself is a wildcard which matches any one character, "\." 
means only "." will match since the backslash was used to escape the "." 
being taken for a wildcard.]

> Also, it was my understanding that "greedy" when applied to regular
> expressions meant it matched as much of the string as possible, as
> opposed to as little.  What about the given regex forces it to be greedy?

   I think "greedy" means what it implies -- that a greedy match results in 
more matches [rather than fewer more specific matches].  The most specific 
reference I can easily find on it at the moment:

       "The "*", "+", and "?" qualifiers are all greedy; they match
        as much text as possible."
           http://docs.python.org/lib/re-syntax.html

   -- Chris   

-- 

Chris Knadle
[EMAIL PROTECTED]
_______________________________________________
mhvlug mailing list
[email protected]
http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug

Reply via email to