Return-Path: X-Original-To: apmail-spamassassin-users-archive@www.apache.org Delivered-To: apmail-spamassassin-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2E6B3106B9 for ; Thu, 27 Feb 2014 01:09:56 +0000 (UTC) Received: (qmail 70437 invoked by uid 500); 27 Feb 2014 01:09:54 -0000 Delivered-To: apmail-spamassassin-users-archive@spamassassin.apache.org Received: (qmail 70391 invoked by uid 500); 27 Feb 2014 01:09:54 -0000 Mailing-List: contact users-help@spamassassin.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@spamassassin.apache.org Received: (qmail 70382 invoked by uid 99); 27 Feb 2014 01:09:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Feb 2014 01:09:53 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [65.18.170.38] (HELO kismet.3phase.com) (65.18.170.38) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Feb 2014 01:09:49 +0000 X-ClientAddr: 109.67.112.126 Received: from [10.0.0.2] ([109.67.112.126]) (authenticated bits=0) by kismet.3phase.com (8.13.8/8.13.8) with ESMTP id s1R19GWD020352 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 26 Feb 2014 20:09:20 -0500 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: help with regex From: Amir Caspi In-Reply-To: <21262.35753.492857.684201@pinky.delphioutpost.com> Date: Wed, 26 Feb 2014 18:09:14 -0700 Cc: "Kevin A. McGrail" , Webmaster , users@spamassassin.apache.org Content-Transfer-Encoding: quoted-printable Message-Id: <9A82AE7E-D75C-4DAA-ADF2-B1D5AEAB0389@3phase.com> References: <530E7E74.2070909@crystal3.com> <530E818A.5020808@PCCC.com> <21262.35753.492857.684201@pinky.delphioutpost.com> To: Jeff Mincy X-Mailer: Apple Mail (2.1874) X-3phase-MailScanner-Information: Please contact the ISP for more information X-3phase-MailScanner-ID: s1R19GWD020352 X-3phase-MailScanner: Found to be clean X-3phase-MailScanner-From: cepheid@3phase.com X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No On Feb 26, 2014, at 5:49 PM, Jeff Mincy wrote: > Can't you do something like this using a look ahead regexp? >=20 > (?=3D[A-Z0-9]{30,})(?:[A-Z]*[0-9]){10,} According to regexpal.com, that matches the OP's example. The lookahead = works properly in this case, since trying to use (say) 28 numbers fails, = while 10 numbers works. As long as SA can do lookahead, I think this = should work. I'm guessing the OP is trying to make a spam template match, much like = the AC_SPAMMY_URI_PATTERNS rules. Typically, though, I've found that = there's no real need to be THAT specific when matching the template; = almost no hammy emails will have alphanumeric strings of 30+ characters. = As long as the rest of the URI match is sufficiently unique, there = shouldn't be a need to be overly specific about the string itself. Of = course, it all depends on the situation, which would be much easier to = assess if the OP posted an example. =3D) Cheers. --- Amir