From owner-freebsd-questions@FreeBSD.ORG Wed Sep 8 00:58:15 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9113B10656AA for ; Wed, 8 Sep 2010 00:58:15 +0000 (UTC) (envelope-from bonomi@mail.r-bonomi.com) Received: from mail.r-bonomi.com (ns2.r-bonomi.com [204.87.227.129]) by mx1.freebsd.org (Postfix) with ESMTP id 6310F8FC08 for ; Wed, 8 Sep 2010 00:58:15 +0000 (UTC) Received: (from bonomi@localhost) by mail.r-bonomi.com (8.14.3/rdb1) id o880uIkA002196; Tue, 7 Sep 2010 19:56:18 -0500 (CDT) Date: Tue, 7 Sep 2010 19:56:18 -0500 (CDT) From: Robert Bonomi Message-ID: <201009080056.o880uIkA002196@mail.r-bonomi.com> To: bernt@bah.homeip.net, drew@mykitchentable.net Cc: frank@shute.org.uk, perryh@pluto.rain.com, freebsd-questions@freebsd.org Subject: Re: Regex Help For Procmail X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2010 00:58:15 -0000 > From owner-freebsd-questions@freebsd.org Tue Sep 7 14:24:56 2010 > Date: Tue, 07 Sep 2010 12:01:40 +0200 > From: Bernt Hansson > To: Drew Tomlinson > Cc: frank@shute.org.uk, perryh@pluto.rain.com, freebsd-questions@freebsd.org > Subject: Re: Regex Help For Procmail > > 2010-09-06 19:46, Drew Tomlinson skrev: > > On 9/5/2010 4:02 PM, perryh@pluto.rain.com wrote: > >> Frank Shute wrote: > >> > >>> Drew, try this: > >>> > >>> * ^From:.*famous-smoke\.com > >>> > >>> I think it's not catching it because the period isn't backslash > >>> escaped ... > >> Unless there's some edge case that I'm not thinking of, adding a > >> backslash to escape a period will never convert a non-match into > >> a match. An unescaped period in an RE matches any character, > >> including a period. An escaped period matches only a period. > > > > I have confirmed this. I did add the backslash but procmail is still not > > matching. > > > >> Adding the backslash _does_ better represent what the OP wants > >> to accomplish, but the lack of it is not the cause of the RE not > >> matching. (I'm not sufficiently familiar with how procmail uses > >> REs to figure out what _is_ causing it not to match.) > > > > True and thus I'll leave the backslash. However I have no idea what _is_ > > causing it not to match either. I'm stumped. > > I think it is the dash. Nope. dashes are 'special' *ONLY within a 'character class' (i.e., within square brackets). > Try to escape it like so: > > * ^From:.*famous\-smoke\.com > Z.