🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #235454

Re: ARG!!!! \b again...

#235454
From: Mike Dee
Date: Sun, 13 Sep 2009 10:47
41 lines
2576 bytes
JimH wrote:

> Ok, now that the previous is working I discover that only half the
> problem is solved. I would also like to match the word "and" along
> with the "&" character in the lines below:
> 
>1) this_&_that
> 2) me_and_you
> 3) here,_there_&_everywhere
> 4) hands_and_feet
> 
> If the use of underscore as a space character was uncommon, I
> wouldn't concern myself with the fact that the regexp \band\b|&
> misses lines 2 and 4 since "_" doesn't trigger a word boundary.
> Unfortunately some of the more desirable posts have come from
> those who do this. 
> 
> The way I see it, the space and underscore are the only two
> characters that are used as whitespaces that need to be matched
> (although I'm not opposed to matching other whitespaces). Is there
> a solution any more "elegant" than: 
> 
> [ _](and|&)[ _]
> 
> (Luckily, I don't recall ever seeing a desired Subject line
> beginning or ending with "and" or "&")

Phase 2? ;-)

Along with word boundaries "\b" there are non-word boundaries "\B"

\B_(and|&)_\B

Will match:
_and_
and
_&_
&

-- 
dee
Technical Details
Message-ID: <Xns9C85D3BE515ADemteedee@87.106.137.111>
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.ams.giganews.com!nntp.giganews.com!news2.euro.net!newsfeed.freenet.de!ecngs!feeder2.ecngs.de!87.106.137.111.MISMATCH!weretis.net!feeder1.news.weretis.net!news.solani.org!not-for-mail
References: <Xns9C852D00C2A53hahadotdotdot@74.209.136.97>

Show Full Headers
Complete Article Headers
Message-ID: <Xns9C85D3BE515ADemteedee@87.106.137.111>
Subject: Re: ARG!!!! \b again...
Date: Sun, 13 Sep 2009 10:47:20 +0000
From: Mike Dee <mikedee@emteedee.invalid>
References: <Xns9C852D00C2A53hahadotdotdot@74.209.136.97>
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.ams.giganews.com!nntp.giganews.com!news2.euro.net!newsfeed.freenet.de!ecngs!feeder2.ecngs.de!87.106.137.111.MISMATCH!weretis.net!feeder1.news.weretis.net!news.solani.org!not-for-mail
Newsgroups: news.software.readers
Organization: Poor Boy
Lines: 41
NNTP-Posting-Host: eJwNwgkRADEIBDBLlHeRQ4H6l3A3iYkf71A3V3u/wNZpoIlAk/HG7jXiHuRkXU5rhoiyj2hscW5ttb6zBf8AUpsVzg==
Mime-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: solani.org
 eJwFwQkBACAIBLBK/EIcRK5/BDfX4Jhj4WEOx9tVsplQT3TXm9tEqPNC2N7OMNc9aJ7r9yXNRbCqb54ETdGIqIdDvHiNJFeeLAhrIDNGecdRi0IGQidVRmBNLRq9aqNUMnvlHvrdmCvE
X-Complaints-To: abuse@news.solani.org
NNTP-Posting-Date: Sun, 13 Sep 2009 10:47:20 +0000 (UTC)
X-Face: $W<X:Uw4$"nTXRHqqZ=.|pFI@K,TNNH0i>-J; N5/yst7]cQb.o^L$oAhs-J!C
 AOUMQ^NHu3aTb9H8awW~4Y.LR`[o}Rz6Xf=^krb-AwUiM"7zA+QR<vWz'8>hKiTOyd]h
 z]7m=[nhuH{NMrE>~][PM`wSKd?TFV-.glh)>N
Cancel-Lock: sha1:c3BxduQyRvoycvfiyEs6k2TdDzo=
User-Agent: Xnews/2009.05.01