Article View: news.software.readers
Article #235446[xnews] Another \b question
From: JimH
Date: Sun, 13 Sep 2009 01:03
Date: Sun, 13 Sep 2009 01:03
25 lines
1658 bytes
1658 bytes
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?
Technical Details
Message-ID:
<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!border2.nntp.ams.giganews.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.242.MISMATCH!nx01.iad01.newshosting.com!newshosting.com!216.196.98.140.MISMATCH!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!gnilink.net!spln!extra.newsguy.com!newsp.newsguy.com!news7Show Full Headers
Complete Article Headers
Message-ID: <Xns9C84D62037159hahadotdotdot@74.209.136.99> Subject: [xnews] Another \b question Date: Sun, 13 Sep 2009 01:03:01 +0000 From: JimH <nvm@nunya.biz> 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!border2.nntp.ams.giganews.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.242.MISMATCH!nx01.iad01.newshosting.com!newshosting.com!216.196.98.140.MISMATCH!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!gnilink.net!spln!extra.newsguy.com!newsp.newsguy.com!news7 Newsgroups: news.software.readers Organization: NewsGuy - Unlimited Usenet $19.95 Lines: 25 NNTP-Posting-Host: pd5c0aafe2a615d360ec65d364c8b4075dfbecba157806549.newsdawg.com User-Agent: Xnews/5.04.25 X-Original-Bytes: 1466