Reject subject filter help with [a-z]

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

Reject subject filter help with [a-z]

Postby gainesb » Thu Jun 17, 2004 8:01 pm

OK, I am frustrated here. I have used regular expressions for over 10 years and can not seem to reject some common spam in subjects in newsbin 4.3.1 that I want to get rid of. I've read the newsbin regex page but it only shows a subset of what a full regex can do.

Example:

Subject: This is the subject (akasdf)

Every spam message ends the subject with a pair of parenthesis with some number of lower case letters between them.

In version 4.3.1, I tried the following. All find a match with "grep" and "vi" on UNIX and the PC editor "textpad". But only a couple match with the newsbin regex matching.

1. ([a-z]+)$ - matches all subjects in 4.31 (why?)
2. \([a-z]+\)$ - matches nothing in 4.31 (shouldn't it)
3. (.+)$ - matches all subjects in 4.31 (why?)
4. \(.+\)$ - matches my string in 4.31 (I don't want all chars in parens)
5. ([^0-9]+)$ - matches all subjects (why?)
6. \([^0-9]+\)$ - matches my string - (not really matching just lower case)

I can't see that the class [a-z] or [A-Z] is working. I tried every possible combination. As I said all six of these regex work in Unix and Textpad, but only #4 and #6 seem to come close in 4.3.1.

How do I reject the subjects of this type? I am sick of this spammer.
gainesb
Occasional Contributor
Occasional Contributor
 
Posts: 13
Joined: Sat Sep 22, 2001 8:36 pm

Registered Newsbin User since: 04/05/03

Postby dexter » Thu Jun 17, 2004 8:13 pm

The regex library linked in to newsbin is not a full regex implementation. Also, everything is forced to case insensitive. You have to play with it to get the results you want.
User avatar
dexter
Site Admin
Site Admin
 
Posts: 9514
Joined: Fri May 18, 2001 3:50 pm
Location: Northern Virginia, US

Registered Newsbin User since: 10/24/97


Return to Regular Expressions

Who is online

Users browsing this forum: No registered users and 12 guests