🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #235456

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

#235456
From: Mike Dee
Date: Sun, 13 Sep 2009 12:48
45 lines
2943 bytes
JimH wrote:

> I don't understand why your regexp will match "and". It seems to
> me that it requires that two underscores appear.

It won't match "and" without the _and_ being present. To explain:

I make judicious use of Xnews's built-in regex tool, and perhaps you
haven't come across it as yet (easy to overlook whats available to
Xnews). 

That is, go: "Special" menu, "Test Regex" submenu.

In the Regex tool dialog that appears; Type in the regex that you
want to test into the top field labeled, "Pattern". Type the text
string that you want to test it against in the second field labeled,
"Test String". Then click the "Match" button. The result will either
be "Match" or "No Match". If there is a match (meaning, the regex
works), you will see the results in the lowest field labeled,
"Matched string and sub-patterns". 

So if you were to enter into the top field labeled "Pattern":

\B_(and|&)_\B

then in the 2nd field labeled "Test String", type:

this_and_that

Clicking the "Match" button you would get a match. In the
lowest field of the dialog you would see it matches the string: 

_and_

but it also matches the sub-pattern in the match: "and".

In this case "and" is a sub-pattern match because of the parenthesis
surrounding (and|&). If you were scoring on only \B_and_\B then you
would get a match of only _and_, - there would be no sub-pattern
"and" to match. 

HTH.

-- 
dee
Technical Details
Message-ID: <Xns9C85E83939B0Cemteedee@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!feeder.news-service.com!weretis.net!feeder1.news.weretis.net!news.solani.org!not-for-mail
References: <Xns9C852D00C2A53hahadotdotdot@74.209.136.97> <Xns9C85D3BE515ADemteedee@87.106.137.111> <Xns9C854F4C319FAhahadotdotdot@74.209.136.98>

Show Full Headers
Complete Article Headers
Message-ID: <Xns9C85E83939B0Cemteedee@87.106.137.111>
Subject: Re: ARG!!!! \b again...
Date: Sun, 13 Sep 2009 12:48:08 +0000
From: Mike Dee <mikedee@emteedee.invalid>
References: <Xns9C852D00C2A53hahadotdotdot@74.209.136.97> <Xns9C85D3BE515ADemteedee@87.106.137.111> <Xns9C854F4C319FAhahadotdotdot@74.209.136.98>
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!feeder.news-service.com!weretis.net!feeder1.news.weretis.net!news.solani.org!not-for-mail
Newsgroups: news.software.readers
Organization: Poor Boy
Lines: 45
NNTP-Posting-Host: eJwFwYkBADAEBLCVqOd0HJT9R2hi4uwNdXO1tU0eYkTGFotZ40qHEHOec2UplW7O03wy6CiqRx4jDBRg9AFBKhTv
Mime-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: solani.org
 eJwdyclxBEEIBECXgIaCMYfTfxNWoWdG2gOjXWFQO7sPoHaquqmZiBWzmbeBGaRuK5M8Mf1KgrpxxRk5YHHlMXEaSq0Qjs04Tg8LsqNKfZtC+mo2PLP+ez9H69UfdxAtBMsgaVF0+Q+9lyxy
X-Complaints-To: abuse@news.solani.org
NNTP-Posting-Date: Sun, 13 Sep 2009 12:48:08 +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:C7iKlI41anw0MjlgsajwFzzAfzc=
User-Agent: Xnews/2009.05.01