Re: [SLUG] regex (for spam filtering in pan)

From: draeath (draeath@gmail.com)
Date: Fri Aug 21 2009 - 14:39:16 EDT


Thanks!

Yea, I know... but it's that particular <nameYEAR@gmail.com>
combination. Anyways, I'm just going to downscore it enough to make it
easy to skip, but without hiding (so I'll still see followups etc)

On Fri, Aug 21, 2009 at 2:32 PM, Eben King<eben01@verizon.net> wrote:
> On Fri, 21 Aug 2009, draeath wrote:
>
>> Fellow sluggers, I need your help.
>>
>> I want to build a regex that would match an email in the form "NAME
>> <ADDR>"
>>
>> Now, let me try to explain how I want the match to work. Maybe you can
>> help me build a working regex, I couldn't figure it out
>>
>> Given ABCDE
>>
>> A = any alpha string or two alpha strings seperated by a space ("John
>> Doe" or "John" but not "John A Doe" or "J4ne Doe")
>> B = Single space char
>> C = less-than (<) char
>> D = any length alpha-only string, followed by either 2 digits or 4
>> digits (ie, "john02 or "john2002" but not "power2you")
>> E = "@gmail.com>"
>>
>> An example address: "Stupid Spammer <lovespam04@gmail.com"
>> A = "Stupid Spammer"
>> B = " "
>> C = "<"
>> D = "lovespam04"
>> E = "@gmail.com>
>>
>> Example matching addresses:
>> John Doe <john09@gmail.com> (both parts match)
>> John <john2009@gmail.com> (both parts match)
>>
>> Example non-matching addresses:
>> draeath <draeath@gmail.com> (NAME matches but ADDR does not)
>> John Q Doe <john09@gmail.com> (ADDR matches, but NAME does not)
>> J4ne Doe <jane123@gmail.com> (neither match)
>>
>> Getting this right will allow me to score down google groups spammers
>> on usenet, while leaving most 'normal' people alone.
>
> Note that lots of mail comes from gmail (my friend's, for example) unrelated
> to GG.
>
> That said, how about '^[A-Za-z]*(
> [A-Za-z]*){,1}<[A-Za-z]([0-9][0-9]){,1}([0-9][0-9]){,1}@gmail\.com>$'
>
> It may need some extra backslashes.  I'm not sure which characters are
> special and which aren't.
>
> --
> "On two occasions I have been asked, -- 'Pray, Mr Babbage, if you put
> into the machine wrong figures, will the right answers come out?'
> ... I am not able rightly to apprehend the kind of confusion of ideas
> that could provoke such a question." -- Charles Babbage, 1864.
> -----------------------------------------------------------------------
> This list is provided as an unmoderated internet service by Networked
> Knowledge Systems (NKS).  Views and opinions expressed in messages
> posted are those of the author and do not necessarily reflect the
> official policy or position of NKS or any of its employees.
>

-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 13:23:47 EDT