LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 10-20-2005, 03:22 AM   #1
realos
Member
 
Registered: Jul 2002
Location: Germany
Distribution: Redhat 7.3, Debian 3.1, Knoppix 3.1, Ubuntu 6.10
Posts: 113

Rep: Reputation: 15
what is wrong with this regular expression in procmail recipe?


In order to sort mailing list postings, I have to add several processing
rules for every list, like:

:0:
* ^To.*gnupg-users@gupg.org
gnupg-users

:0:
* ^Cc.*gnupg-users@gupg.org
gnupg-users

Trying to put it up in one single rule, I end up with the following 3
line which unfortunaley do not work correctly.

:0:
* ^(T[Oo]|C[Cc]).*gnupg-users@gupg.org
gnupg-users

Idea is to sort all mails with any of these headers (To, TO, CC, Cc)
into "gunpg-users" mailing list.

Any idea what is wrong with that reqular expression?

cheers,
 
Old 10-20-2005, 08:23 AM   #2
rosholm
LQ Newbie
 
Registered: May 2005
Location: Copenhagen, Denmark
Distribution: FC4 x86_64
Posts: 13

Rep: Reputation: 0
Try escaping | i.e use \|

If this does not work, maybe you need to group T[Oo] and C[Cc] because | (or \|) maybe only operates on one character or group on each side.
 
Old 10-20-2005, 09:07 AM   #3
realos
Member
 
Registered: Jul 2002
Location: Germany
Distribution: Redhat 7.3, Debian 3.1, Knoppix 3.1, Ubuntu 6.10
Posts: 113

Original Poster
Rep: Reputation: 15
no mate, it does not work. I can live with multiple entries or multiple parallel entries but would like to have it writen in a compact way with [], | and ().

It seems I will have to read up a bit more or wait for other ideas here on forum.
 
Old 10-20-2005, 09:17 AM   #4
rosholm
LQ Newbie
 
Registered: May 2005
Location: Copenhagen, Denmark
Distribution: FC4 x86_64
Posts: 13

Rep: Reputation: 0
Are you sure that you don't need to escape the special characters?

I would try
:0:
* ^T[0o].*gnupg-users@gupg.org
gnupg-users

to see if [] works, then
:0:
* ^T(0|o).*gnupg-users@gupg.org
gnupg-users

to see if (|) works... and so on.

Obviously the syntax is not the same as in e.g. sed expressions - on my system that is
 
Old 10-20-2005, 09:35 AM   #5
rosholm
LQ Newbie
 
Registered: May 2005
Location: Copenhagen, Denmark
Distribution: FC4 x86_64
Posts: 13

Rep: Reputation: 0
Ok, final suggestion from me:

[Oo]|C[Cc] might evaluate to a list of the charcters O,o,],|,C,[,C and c

Maybe
((T[Oo])|(C[Cc]))

is the solution?

Good luck!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Three actions in a recipe of Procmail Borelian Linux - Software 1 11-11-2012 06:48 AM
Procmail - help w/ recipe to sort mailer-daemons Ratclaws Linux - Software 1 07-12-2005 04:17 PM
Procmail recipe jebix666 Linux - General 1 06-09-2005 01:43 PM
procmail recipe for charset conversion Peff Linux - Software 0 07-13-2004 02:40 AM
procmail recipe not working? theLIGHT Linux - Software 3 11-18-2002 10:04 PM


All times are GMT -5. The time now is 02:54 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration