Article View: news.software.readers
Article #235448Re: [xnews] Another \b question
From: me
Date: Sun, 13 Sep 2009 03:06
Date: Sun, 13 Sep 2009 03:06
37 lines
2080 bytes
2080 bytes
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 -- Replies to: Nherr1professor2doktor31109(at)Oyahoo(dot)Tcom
Technical Details
Message-ID:
<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.ams.giganews.com!nntp.giganews.com!feeder.erje.net!newsfeed.straub-nv.de!feeder.eternal-september.org!eternal-september.org!not-for-mailReferences:
<Xns9C84D62037159hahadotdotdot@74.209.136.99>Show Full Headers
Complete Article Headers
Message-ID: <Xns9C84EB0FCAE24metadyataminvalid@feeder.eternal-september.org> Subject: Re: [xnews] Another \b question Date: Sat, 12 Sep 2009 23:06:26 -0400 From: me@tadyatam.invalid References: <Xns9C84D62037159hahadotdotdot@74.209.136.99> 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.erje.net!newsfeed.straub-nv.de!feeder.eternal-september.org!eternal-september.org!not-for-mail Newsgroups: news.software.readers Organization: A noiseless patient Spider Lines: 37 X-Trace: news.eternal-september.org U2FsdGVkX1/KJROzPIb+YX+0RKR1HU9k7LcbYgXPSERaKV7TWC547B4mUYoQ/oZj2bFi5kW+gXWHxD/50wqVYEoETHbjahAI3h/OfEAg6zCYYu0ucKZxdmWQiMXa2lenyEGnwfDwwKE= X-Complaints-To: abuse@eternal-september.org NNTP-Posting-Date: Sun, 13 Sep 2009 03:06:31 +0000 (UTC) X-No-Archive: yes X-Auth-Sender: U2FsdGVkX1+ACbXvR6x7KhOvXlPlPHaZWzp7vt98pdw= Cancel-Lock: sha1:Uda+Ka6Q4VpzcL1hXITDI5Mp7UQ= User-Agent: Xnews/2006.08.21