Date: Fri, 14 Apr 2000 16:12:44 -0400 From: William Freeman <wdf@picusnet.com> To: Arcady Genkin <a.genkin@utoronto.ca> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: A sed question Message-ID: <38F77BBC.A8F87F05@picusnet.com> References: <87k8i0zbj8.fsf@tea.thpoon.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--------------4294A24A6F1F27630C57EC4E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Perhaps Perl would work better? Arcady Genkin wrote: > 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 -- William D. Freeman (wdf@picusnet.com) http://members.xoom.com/EvilGNU -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GU d- s+:+ a--- C++ UB+++ P+ L- E--- W+ N o-- K- w--- O- M- V-- PS+ PE++ Y-- PGP-- t++ 5-- X+++ R tv- b+ DI++++ D--- G- e- h! r-- !y+ ------END GEEK CODE BLOCK------ --------------4294A24A6F1F27630C57EC4E Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> Perhaps Perl would work better? <br> <br> <br> <p>Arcady Genkin wrote: <blockquote TYPE=CITE>I'm setting up a procmail rule to filter message through sed to remove <br>mailing list ids in subject line. I miss "|" in sed's syntaxis. For <br>example I have a rule: <p>,----[ .procmailrc ] <br>| :0 f <br>| * ^mailing-list:.*\/(php3-help|php4beta) <br>| |sed '/^Subject:/ s/\[PHP[34]\(BETA\)*\] *//g' <br>| <br>| :0 A: <br>| lists/programming/$MATCH <br>`---- <p>But the regexp in the sed's command above is not *exactly* the <br>language that I meant. I wanted to match [PHP3] or [PHP4BETA]. Or, in <br>other words \[PHP(3|4BETA)\]. But the above would allow a match on <br>[PHP3BETA], as well as [PHP4] and [PHP4BETABETABETA]. I know this is <br>silly, but I feel defeated because I can't express exactly what I <br>need. <p>Is there a way around this missing "|" metacharacter? <p>Can I specify *two* commands per line? <p>Thanks! <br>-- <br>Arcady Genkin <a href="http://www.thpoon.com">http://www.thpoon.com</a>; <br>Nostalgia isn't what it used to be. <p>To Unsubscribe: send mail to majordomo@FreeBSD.org <br>with "unsubscribe freebsd-questions" in the body of the message</blockquote> <pre>-- William D. Freeman (wdf@picusnet.com) <A HREF="http://members.xoom.com/EvilGNU">http://members.xoom.com/EvilGNU</A>; -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GU d- s+:+ a--- C++ UB+++ P+ L- E--- W+ N o-- K- w--- O- M- V-- PS+ PE++ Y-- PGP-- t++ 5-- X+++ R tv- b+ DI++++ D--- G- e- h! r-- !y+ ------END GEEK CODE BLOCK------</pre> </html> --------------4294A24A6F1F27630C57EC4E-- 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?38F77BBC.A8F87F05>