๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
58 messages
58 total messages Page 2 of 2 Started by Ammammata Sun, 06 Sep 2009 18:02
Page 2 of 2 โ€ข 58 total messages
Re: [xnews] set score and move message
#235429
Author: JimH
Date: Fri, 11 Sep 2009 13:34
37 lines
2489 bytes
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).
Re: [xnews] set score and move message
#235438
Author: Mike Dee
Date: Sat, 12 Sep 2009 11:15
63 lines
3919 bytes
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. 

-- 
dee
Re: [xnews] \b use
#235440
Author: JimH
Date: Sat, 12 Sep 2009 11:43
81 lines
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)
Re: [xnews] \b use
#235442
Author: ยปQยซ
Date: Sat, 12 Sep 2009 14:07
33 lines
2576 bytes
In <news:Xns9C844E800540Fhahadotdotdot@74.209.136.98>,
JimH <nvm@nunya.biz> wrote:

> 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

No.  \b\b matches the same things \b does

> If not, any suggestions?
> 
> (Basically, I'm looking to completely ignore anything between the two 
> strings)

stringone.*\b.*stringtwo

.*\b.* matches any number of characters between the two strings as long
as there is at least one word boundary among them.

FWIW, <http://xnews.remarqs.net/score.htm> has links to a few regular
expression sites I thought were useful.  In particular, for learning
about them and playing with them, the last two links are great, the
tutorials and The Regex Coach.  (The Regex Coach uses its own regex
engine, but it's designed to be Perl-compatible, so it mostly agrees
with Xnews' regexes.)
Re: [xnews] \b use
#235443
Author: Mike Yetto
Date: Sat, 12 Sep 2009 14:16
39 lines
3073 bytes
Bada bing JimH <nvm@nunya.biz> bada bang:
> 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?
>

Don't over think this.  Just look for two different strings with
an unknown amount of text between them.

> \bfirst text\b\bsecond text\b

This will look for _first textsecond text_ with nothing but a
word boundary between text and second.  If there is nothing
between them, there is nothing to define a word boundary and this
regex will never find anything.

>
> If not, any suggestions?
>

\bfirst text\b.*\bsecond text\b

> (Basically, I'm looking to completely ignore anything between the two 
> strings)

This will not ignore everything between them, it will accept
anything between them and register a hit.


Mike "that's just semantics... not it's not... yes it is..." Yetto
-- 
Pluralitas non est ponenda sine necessitate.
 - William of Ockham
Re: [xnews] \b use
#235441
Author: JimH
Date: Sat, 12 Sep 2009 15:12
43 lines
3000 bytes
=?UTF-8?B?wrtRwqs=?= <boxcars@gmx.net> wrote in 
news:20090912090739.12529362@bellgrove.remarqs.net:

> In <news:Xns9C844E800540Fhahadotdotdot@74.209.136.98>,
> JimH <nvm@nunya.biz> wrote:
> 
>> 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
> 
> No.  \b\b matches the same things \b does
> 
>> If not, any suggestions?
>> 
>> (Basically, I'm looking to completely ignore anything between the two 
>> strings)
> 
> stringone.*\b.*stringtwo
> 
> .*\b.* matches any number of characters between the two strings as long
> as there is at least one word boundary among them.
> 
> FWIW, <http://xnews.remarqs.net/score.htm> has links to a few regular
> expression sites I thought were useful.  In particular, for learning
> about them and playing with them, the last two links are great, the
> tutorials and The Regex Coach.  (The Regex Coach uses its own regex
> engine, but it's designed to be Perl-compatible, so it mostly agrees
> with Xnews' regexes.)

I hadn't seen that page before, thank you.

>From Googling I had found the last one, and it is very useful... but I'm 
afraid I've gotten all I can from it. That's not to say it doesn't have 
more to offer, just that for me it's not "sinking in." :)
Re: [xnews] \b use
#235444
Author: JimH
Date: Sat, 12 Sep 2009 15:26
46 lines
2921 bytes
Mike Yetto <myetto1@nycap.invalid> wrote in
news:slrn20090912100732.373.twooffive@may.eternal-september.org: 

> Bada bing JimH <nvm@nunya.biz> bada bang:
>> 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?
>>
> 
> Don't over think this.  Just look for two different strings with
> an unknown amount of text between them.
> 
>> \bfirst text\b\bsecond text\b
> 
> This will look for _first textsecond text_ with nothing but a
> word boundary between text and second.  If there is nothing
> between them, there is nothing to define a word boundary and this
> regex will never find anything.
> 
>>
>> If not, any suggestions?
>>
> 
> \bfirst text\b.*\bsecond text\b
> 
>> (Basically, I'm looking to completely ignore anything between the two 
>> strings)
> 
> This will not ignore everything between them, it will accept
> anything between them and register a hit.
> 
> 
> Mike "that's just semantics... not it's not... yes it is..." Yetto


Yeah, a minute or two after I posted that I realized something was missing. 
And yes, by "ignore" I did mean to say "not care." Thank you.

I can see now that your regexp works better than I had anticipated.
Page 2 of 2 โ€ข 58 total messages
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads