Article View: news.software.readers
Article #235440Re: [xnews] \b use
From: JimH
Date: Sat, 12 Sep 2009 11:43
Date: Sat, 12 Sep 2009 11:43
81 lines
4099 bytes
4099 bytes
Mike Dee <mikedee@emteedee.invalid> wrote in news:Xns9C84D8825B0B9emteedee@ 87.106.137.111: > JimH wrote: > >> Mike Dee <mikedee@emteedee.invalid> wrote in >> news:Xns9C8378CF1712Aemteedee@87.106.137.111: >> >>> JimH wrote: >>> >>>> ^(re:)?\bo/?\.?t\b >>> >>> Emphatically; No. >>> >>> What you have there, works only on strings beginning: >>> >>> ot, o/t, o.t >>> Re:ot, Re:o/t, Re:o.t >>> >>> And that's it. Notice there is no space between the colon and the >>> "o". - OK, so you didn't put a space after the colon in "^(re:)?" >>> which is an easy fix, but it still requires that a post begins >>> "ot" with no allowing of braces of any kind, or possible >>> punctuations preceding the "O". A post beginning [OT] would not >>> work IOW. >>> >>> If there is any post in this thread that I can agree on 100%, it >>> is <<Q>>'s, who says it far more eloquently and succinctly than I >>> can: <news:20090909171735.090a6d55@bellgrove.remarqs.net> >> >> The reason I didn't include the space was because of the first \b. >> As I've said, I'm not that familiar with this escape sequence - >> and therefore don't feel comfortable using it, and would probably >> make many mistakes. >> >> (While composing this reply I did learn that \b triggers on a >> change of character TYPE, not on a character itself.) >> >> I'll probably be sticking to explicit calls for a while since it's >> easier for me to envision while writing it (even though I'll agree >> 100% that it's much harder to read). > > Hi JimH, > > The \b denotes a word boundary, nothing more nor less. > > It works on the beginning of a word, as in: \bling - which would > find a word like "Ling" or "linger" but it will ignore a word like > "trembling". > > Or the ending of a word, as in: fling\b which would find a word like > "halfling" or "fling" but it will ignore words like "flinging", > "flings" or "halflings" etc. > > Or both the beginning AND ends of a word, as in: \bother\b which in > this example it will find only the word "other" and not "others", > "brother" or "otherworldly" etc. > > The latter example is why \bot\b is so suited to finding *only* > "OT", or if you are slightly pedantic (like me) using for example; > \bo/?\.?t\b to find potential differences that may occur between > only the "o" and the "t" boundaries of "OT" and nothing else to > either side of that. > I'm curious.... Let's say I'm looking for a subject line that would consist of two strings, "first text" and "second text". I can be absolutely certain that there will be at least one word boundary between them, and it's extremely likely there will be many more than that. Would the following regexp work in the cases where there are two or more word boundaries between the two strings? \bfirst text\b\bsecond text\b If not, any suggestions? (Basically, I'm looking to completely ignore anything between the two strings)
Technical Details
Message-ID:
<Xns9C844E800540Fhahadotdotdot@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!newsfeed.freenet.de!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!spln!extra.newsguy.com!newsp.newsguy.com!news6References:
<Xns9C7ECBDA4BECAammammatatiscalineti@194.177.97.96> <Xns9C7ECF92E972Chahadotdotdot@74.209.136.98> <Xns9C818F65AE920emteedee@87.106.137.111> <Xns9C81395E0DB70hahadotdotdot@74.209.136.94> <Xns9C8378CF1712Aemteedee@87.106.137.111> <Xns9C836157A806Chahadotdotdot@74.209.136.81> <Xns9C84D8825B0B9emteedee@87.106.137.111>Show Full Headers
Complete Article Headers
Message-ID: <Xns9C844E800540Fhahadotdotdot@74.209.136.98> Subject: Re: [xnews] \b use Date: Sat, 12 Sep 2009 11:43:09 +0000 From: JimH <nvm@nunya.biz> References: <Xns9C7ECBDA4BECAammammatatiscalineti@194.177.97.96> <Xns9C7ECF92E972Chahadotdotdot@74.209.136.98> <Xns9C818F65AE920emteedee@87.106.137.111> <Xns9C81395E0DB70hahadotdotdot@74.209.136.94> <Xns9C8378CF1712Aemteedee@87.106.137.111> <Xns9C836157A806Chahadotdotdot@74.209.136.81> <Xns9C84D8825B0B9emteedee@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!newsfeed.freenet.de!news-out1.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: 81 NNTP-Posting-Host: p34cc35ed526d63fba08a1b8c572b7a8453e5fb504b1380f2.newsdawg.com User-Agent: Xnews/5.04.25