Article View: news.software.readers
Article #45833Re: slrn regexp FAQ?
From: Dawn Owens-Nicholson
Date: Sun, 10 Jan 1999 00:00
Date: Sun, 10 Jan 1999 00:00
33 lines
1972 bytes
1972 bytes
David Gerard wrote:
> Ah ha! So what I want is something like:
>
> Message-ID: <\d*@
>
> to get all message-IDs where the portion before the @ is entirely numeric?
> (If * does what I think it does.)
No, it doesn't do what you think it does. In regular expressions, '*'
commonly means "0 or more repetitions of the previous character (or
construct)". Your regex will match "<@foobar.org>" which has no numbers at
all. Here, "<\d*@" means "<" followed by any number of digits (including no
digits--0 repetitions) followed by "@". You probably want
Message-ID: ^<\d+@
Because '^' will anchor the search at the beginning of the message-ID (the
only place "<" is legal in a message-ID; putting this in here will probably
speed the search slightly) and '+' means "1 or more repetions of the
previous character" in S-Lang regular expressions.
I haven't seen the message-IDs you're trying to match, but do these spammers
have access to some servers that will accept bad message-IDs? If so, you
might want to make the "<" optional: (if this isn't a problem, don't bother
matching for it)
Message-ID: ^<?\d+@
So, any message-ID that has at least one digit before the "@" will match.
Happy (spam-free) newsreading!
Technical Details
Message-ID:
<slrn79i24n.8po.bluemoon@ux6.cso.uiuc.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<776o5l$20o$6@youknow.apana.org.au> <slrn79drjj.5r1.lahvak@math.mps.ohio-state.edu> <779qkj$2t8$5@youknow.apana.org.au>Show Full Headers
Complete Article Headers
Message-ID: <slrn79i24n.8po.bluemoon@ux6.cso.uiuc.edu> Subject: Re: slrn regexp FAQ? Date: Sun, 10 Jan 1999 00:00:00 +0000 From: bluemoon@ux6.cso.uiuc.edu (Dawn Owens-Nicholson) References: <776o5l$20o$6@youknow.apana.org.au> <slrn79drjj.5r1.lahvak@math.mps.ohio-state.edu> <779qkj$2t8$5@youknow.apana.org.au> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 430980651 Organization: University of Illinois at Urbana-Champaign User-Agent: slrn/0.9.5.4 (UNIX) Newsgroups: news.software.readers