🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
7 messages
7 total messages Started by Adam Funk Sun, 21 Nov 2010 14:53
help with leafnode 2 only_groups_pcre regex?
#243315
Author: Adam Funk
Date: Sun, 21 Nov 2010 14:53
23 lines
1756 bytes
I'm trying to use an only_groups_pcre expression to exclude any groups
that start with 'gmane'.  This doesn't work:

only_groups_pcre = ^(?<!gmane\.).*$

and I have a hard time getting my head around the negative kind.  I'd
appreciate any help.


Background, in case anyone is curious:

I discovered yesterday that nntp.aioe.org now carries a bunch of
gmane.* groups, but all flagged 'n' (no posting), and when leafnode
(version 2.0.0.alpha20090908a.luascript in my case) merges group lists
from different servers, it doesn't consistently deal with differences
in the flags (the group I was posting to is 'm' (moderated) on
news.gmane.org).


-- 
"Gonzo, is that the contract from the devil?"
"No, Kermit, it's worse than that. This is the bill from special
effects."
Re: help with leafnode 2 only_groups_pcre regex?
#243325
Author: Christian Ebert
Date: Sun, 21 Nov 2010 17:23
22 lines
2059 bytes
* Adam Funk on Sunday, November 21, 2010:
> I'm trying to use an only_groups_pcre expression to exclude any groups
> that start with 'gmane'.  This doesn't work:
> 
> only_groups_pcre = ^(?<!gmane\.).*$

Almost.

> and I have a hard time getting my head around the negative kind.  I'd
> appreciate any help.

only_groups_pcre = (?!gmane\.)

iirc, you don't need ^ and .*$, as the match starts at the
beginning of the line.

c
-- 
\black\trash movie   _SAME  TIME  SAME  PLACE_
	       New York, in the summer of 2001

--->> http://www.blacktrash.org/underdogma/stsp.php
Re: help with leafnode 2 only_groups_pcre regex?
#243333
Author: Adam Funk
Date: Sun, 21 Nov 2010 21:41
32 lines
2135 bytes
On 2010-11-21, Christian Ebert wrote:

> * Adam Funk on Sunday, November 21, 2010:
>> I'm trying to use an only_groups_pcre expression to exclude any groups
>> that start with 'gmane'.  This doesn't work:
>> 
>> only_groups_pcre = ^(?<!gmane\.).*$
>
> Almost.
>
>> and I have a hard time getting my head around the negative kind.  I'd
>> appreciate any help.
>
> only_groups_pcre = (?!gmane\.)
>
> iirc, you don't need ^ and .*$, as the match starts at the
> beginning of the line.

That did the trick, thanks!

The regex I was attempting to work from eliminates binary-like group
names:

only_groups_pcre = ^([\+\-\w]+)(\.[\+\-\w]+(?<!binaries|binary|mp3|warez|binares|binarios|binari|binair))*$

What does the "<" in the "?<!" do there?


-- 
No right of private conversation was enumerated in the Constitution.
I don't suppose it occurred to anyone at the time that it could be
prevented.                                        [Whitfield Diffie]
Re: help with leafnode 2 only_groups_pcre regex?
#243339
Author: Christian Ebert
Date: Sun, 21 Nov 2010 23:40
17 lines
2020 bytes
* Adam Funk on Sunday, November 21, 2010:
> The regex I was attempting to work from eliminates binary-like group
> names:
> 
> only_groups_pcre = ^([\+\-\w]+)(\.[\+\-\w]+(?<!binaries|binary|mp3|warez|binares|binarios|binari|binair))*$
> 
> What does the "<" in the "?<!" do there?

That's called a "negative lookbehind assertion". In case you want
to get a headache, consult man pcrepattern ;-)

c
-- 
\black\trash movie    _MORALISK  ANSTALT_
                        "Nix verstanden."

--->> http://www.blacktrash.org/underdogma/moraliskanstalt.php
Re: help with leafnode 2 only_groups_pcre regex?
#243432
Author: Adam Funk
Date: Wed, 24 Nov 2010 16:00
22 lines
1897 bytes
On 2010-11-21, Christian Ebert wrote:

> * Adam Funk on Sunday, November 21, 2010:
>> The regex I was attempting to work from eliminates binary-like group
>> names:
>> 
>> only_groups_pcre = ^([\+\-\w]+)(\.[\+\-\w]+(?<!binaries|binary|mp3|warez|binares|binarios|binari|binair))*$
>> 
>> What does the "<" in the "?<!" do there?
>
> That's called a "negative lookbehind assertion". In case you want
> to get a headache, consult man pcrepattern ;-)


Well, I didn't make that regex up myself!  I think I got it here or on
the leafnode list.


-- 
The three-martini lunch is the epitome of American efficiency.
Where else can you get an earful, a bellyful and a snootful at
the same time?                             [Gerald Ford, 1978]
Re: help with leafnode 2 only_groups_pcre regex?
#243443
Author: Christian Ebert
Date: Wed, 24 Nov 2010 17:33
22 lines
2409 bytes
* Adam Funk on Wednesday, November 24, 2010:
> On 2010-11-21, Christian Ebert wrote:
>> * Adam Funk on Sunday, November 21, 2010:
>>> only_groups_pcre = ^([\+\-\w]+)(\.[\+\-\w]+(?<!binaries|binary|mp3|warez|binares|binarios|binari|binair))*$
>>> 
>>> What does the "<" in the "?<!" do there?
>> 
>> That's called a "negative lookbehind assertion". In case you want
>> to get a headache, consult man pcrepattern ;-)
> 
> Well, I didn't make that regex up myself!

I never accused you of that!

> I think I got it here or on the leafnode list.

I only accuse you of wanting to know what it means!

c
-- 
So dacht ich. Nächstens mehr.
_HÖLDERLIN:  HYPERION_  --->> http://www.blacktrash.org/hyperion
Re: help with leafnode 2 only_groups_pcre regex?
#243447
Author: Adam Funk
Date: Wed, 24 Nov 2010 20:48
29 lines
1979 bytes
On 2010-11-24, Christian Ebert wrote:

> * Adam Funk on Wednesday, November 24, 2010:
>> On 2010-11-21, Christian Ebert wrote:
>>> * Adam Funk on Sunday, November 21, 2010:
>>>> only_groups_pcre = ^([\+\-\w]+)(\.[\+\-\w]+(?<!binaries|binary|mp3|warez|binares|binarios|binari|binair))*$
>>>> 
>>>> What does the "<" in the "?<!" do there?
>>> 
>>> That's called a "negative lookbehind assertion". In case you want
>>> to get a headache, consult man pcrepattern ;-)
>> 
>> Well, I didn't make that regex up myself!
>
> I never accused you of that!

LOL, whoever figured it out should get a prize!


>> I think I got it here or on the leafnode list.
>
> I only accuse you of wanting to know what it means!

Sometimes my curiosity gets the better of me.


-- 
War is God's way of teaching Americans geography.
                                 [Ambrose Bierce]
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