Date: 14 Apr 2000 16:13:15 -0400 From: Arcady Genkin <a.genkin@utoronto.ca> To: freebsd-questions@FreeBSD.ORG Subject: A sed question Message-ID: <87k8i0zbj8.fsf@tea.thpoon.com>
next in thread | raw e-mail | index | archive | help
I'm setting up a procmail rule to filter message through sed to remove mailing list ids in subject line. I miss "|" in sed's syntaxis. For example I have a rule: ,----[ .procmailrc ] | :0 f | * ^mailing-list:.*\/(php3-help|php4beta) | |sed '/^Subject:/ s/\[PHP[34]\(BETA\)*\] *//g' | | :0 A: | lists/programming/$MATCH `---- But the regexp in the sed's command above is not *exactly* the language that I meant. I wanted to match [PHP3] or [PHP4BETA]. Or, in other words \[PHP(3|4BETA)\]. But the above would allow a match on [PHP3BETA], as well as [PHP4] and [PHP4BETABETABETA]. I know this is silly, but I feel defeated because I can't express exactly what I need. Is there a way around this missing "|" metacharacter? Can I specify *two* commands per line? Thanks! -- Arcady Genkin http://www.thpoon.com Nostalgia isn't what it used to be. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87k8i0zbj8.fsf>