🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #74223

Re: Renaming a newsgroup

#74223
From: Dr.Ruud
Date: Mon, 11 Sep 2006 14:11
23 lines
1734 bytes
John F. Morse schreef:

> #!/usr/bin/perl -wi
> my ($src, $dst) = (shift, shift);
> die "Usage: $0 oldgroup newgroup [file1 [file2 ...]]\n"
>     unless(defined $dst);
> while(<>) {
>     s/$src/$dst/g if 1 .. /^$/ and /^(Newsgroups|Followup-To|Xref):/i;

If $src can contain regex-special characters like .?*+{[^$@
then change that substitution to

     s/\Q$src/$dst/g

The \Q will quote all non-word-characters, see perlre and perlop and
quotemeta().

-- 
Affijn, Ruud

"Gewoon is een tijger."

Technical Details
Message-ID: <ee42fj.188.1@news.isolution.nl>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.germany.com!multikabel.net!feed20.multikabel.net!news2.euro.net!212.78.160.12.MISMATCH!news.nl.colt.net!newsgate.cistron.nl!xs4all!transit4.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
References: <AiTMg.17827$QM6.1566@bgtnsc05-news.ops.worldnet.att.net>

Show Full Headers
Complete Article Headers
Message-ID: <ee42fj.188.1@news.isolution.nl>
Subject: Re: Renaming a newsgroup
Date: Mon, 11 Sep 2006 16:11:16 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
References: <AiTMg.17827$QM6.1566@bgtnsc05-news.ops.worldnet.att.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.germany.com!multikabel.net!feed20.multikabel.net!news2.euro.net!212.78.160.12.MISMATCH!news.nl.colt.net!newsgate.cistron.nl!xs4all!transit4.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Newsgroups: news.software.nntp
Organization: Chaos rules.
X-Newsreader: WMDIYB
X-Archive-Me: please
Approved: yesterday
X-Face: &CQ$FIr!=+=w,8`0Q^Ug"1>F[(/op8->E; NQet`5fe$;
 =e*!Z5&REvp<~Tj|"Y[|8OcJ{w#z&mB7B:I)XO*%_|\]|YW$C>>$Q[9-#K~c$tQ^Mf0,wMo?h\C)TE>f
Lines: 23
NNTP-Posting-Host: 194.109.13.140
X-Trace: 1157985004 news.xs4all.nl 4514 [::ffff:194.109.13.140]:3895
X-Complaints-To: abuse@xs4all.nl