Article View: news.software.readers
Article #235452Re: [xnews] Another \b question
From: JimH
Date: Sun, 13 Sep 2009 07:32
Date: Sun, 13 Sep 2009 07:32
42 lines
1980 bytes
1980 bytes
me@tadyatam.invalid wrote in news:Xns9C84EB0FCAE24metadyataminvalid@feeder.eternal-september.org: > JimH <nvm@nunya.biz> wrote in > news:Xns9C84D62037159hahadotdotdot@74.209.136.99: > >> I'm trying to get familiar with \b, and I've hit a snag >> that I can't find an answer for. >> >> I'm trying to match with either the word "and" or the >> character "&". >> >> I created the following four lines of text to test my >> regexp on: >> >> 1) this & that >> 2) me and you >> 3) here, there & everywhere >> 4) hands and feet >> >> When I use the regexp (and|&) it will match everywhere >> desired, but of course also gives an unwanted match on the >> word "hands." (I put it there specifically for the false >> match) >> >> So I changed the regexp to: >> >> \b(and|&)\b >> >> Now it matches only the word "and" on lines 2 and 4, but >> not the "&" in lines 1 and 3. Why? >> >> What change do I need to make? >> > > Because "&" is not a word. > > J It figures.
Technical Details
Message-ID:
<Xns9C8523E9E2546hahadotdotdot@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.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!83.128.0.12.MISMATCH!news-out2.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!spln!extra.newsguy.com!newsp.newsguy.com!news6References:
<Xns9C84D62037159hahadotdotdot@74.209.136.99> <Xns9C84EB0FCAE24metadyataminvalid@feeder.eternal-september.org>Show Full Headers
Complete Article Headers
Message-ID: <Xns9C8523E9E2546hahadotdotdot@74.209.136.97> Subject: Re: [xnews] Another \b question Date: Sun, 13 Sep 2009 07:32:10 +0000 From: JimH <nvm@nunya.biz> References: <Xns9C84D62037159hahadotdotdot@74.209.136.99> <Xns9C84EB0FCAE24metadyataminvalid@feeder.eternal-september.org> 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.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!83.128.0.12.MISMATCH!news-out2.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!spln!extra.newsguy.com!newsp.newsguy.com!news6 Newsgroups: news.software.readers Organization: NewsGuy - Unlimited Usenet $19.95 Lines: 42 NNTP-Posting-Host: p14b880954cf3c7bb7c8692fac7e11a79a9404d92fe282380.newsdawg.com User-Agent: Xnews/5.04.25