🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #243265

Re: Dialog (regex defect): Action rule using "Header" scans into body of post

#243265
From: Tom B.
Date: Wed, 17 Nov 2010 20:36
37 lines
2879 bytes
VanguardLH wrote in "news.software.readers" ...

[trimmed]

> I guess I'm still engrained in the old C programming style where 
> \n
> meant newline which could be \n or \r\n depending on the OS where the
> end-of-line sequence was being added to the document.  So I figured on
> Windows that \n meant the CR-LF sequence.  Well, according to the wiki
> article at http://en.wikipedia.org/wiki/Newline, PCRE might still only
> be using \n as the linefeed character.
> 
> I replace the $ trailing anchor (for end-of-line) with \r\n, as in:
> 
> ^Path: .+![^!]+\.othernsp\.com(!not-for-mail)?\r
> 
> This worked to match on just the trailing text in the same line as where
> the Path header is defined.  I didn't even need the (?-s) operator
> (which doesn't seem implemented in Dialog).  \r\n also worked at the end
> of the Path header to delimit the parsing to just that line.  While the
> \n (linefeed, not the newline that I'm used to from C) is used in
> Windows, it isn't required on other OS platforms to denote the
> end-of-line marker.  So hopefully just \r is all I need to use in
> replacing the $ anchor.

I think the universal "\n" is for *printing* so the C program or 
perl script will print the appropriate line ends depending on the 
OS. But usenet articles always (I think always) use 0D 0A for line 
endings or new lines regardless of the OS.

I have not tried it but "\r" probably works as well as "\r\n" 
because the \r would match first, so the \n may be extraneous.

-- 
Tom B.      * * * Gravity Web Pages  * * *
http://mpgravity.sourceforge.net/ (official site)
http://gravity.tbates.org/
Technical Details
Message-ID: <MPG.274e06ba110aef659896b5@news.individual.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <ibieuc$fa1$1@news.albasani.net> <4jnelelbf8ic.dlg@mid.crommatograph.info> <ibrutm$26h$1@news.albasani.net> <ibt23d$lq6$1@news.albasani.net> <MPG.274c0684271c22009896b2@news.individual.net> <ibuse3$g7b$1@news.albasani.net>

Show Full Headers
Complete Article Headers
Message-ID: <MPG.274e06ba110aef659896b5@news.individual.net>
Subject: Re: Dialog (regex defect): Action rule using "Header" scans into body of post
Date: Wed, 17 Nov 2010 15:36:04 -0500
From: "Tom B." <nfn03862@naples.net>
References: <ibieuc$fa1$1@news.albasani.net> <4jnelelbf8ic.dlg@mid.crommatograph.info> <ibrutm$26h$1@news.albasani.net> <ibt23d$lq6$1@news.albasani.net> <MPG.274c0684271c22009896b2@news.individual.net> <ibuse3$g7b$1@news.albasani.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
Newsgroups: news.software.readers
Lines: 37
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: individual.net 1JUZ6LWzTncNQ0UNKDx4Swr7zmvSEeJTgYbaLwxB4AmQlnCmc=
Cancel-Lock: sha1:9VfkkxfyJzwWma41cEX/mSQs7T0=
User-Agent: MicroPlanet-Gravity/3.0.4
X-Original-Bytes: 2619