Thread View: news.software.readers
15 messages
15 total messages
Started by DC
Thu, 06 Jan 2005 23:09
[slrn] Need help with score regexp
Author: DC
Date: Thu, 06 Jan 2005 23:09
Date: Thu, 06 Jan 2005 23:09
37 lines
1889 bytes
1889 bytes
I am trying to devise a regular expression that will match x or more
consecutive occurrences of any character, except digits.
Fer instance...
- 4 or more of *any* letter
i.e.
Subject: Heeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelp!
- 4 or more special chars like ~!@#$%^&*()-_=+[]{}|\/;:'"`<>,.?
i.e.
Subject: Help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
or my personal fave
Subject: Re: [[[[[ DO'NT OPEN,,VIURS!1 ]]]]] See Anna Kournikova Naked
}:O)
I wish to allow digits, however, but not in this particular instance:
Subject: HELP!!!!!!1!111!1!!!!!!!111!!!111111!!!!!
Thanks.
PS: A link to an excellent online reference/tutorial for writing s-lang
regexps would be very welcome, also.
--
DC Linux RU #1000111011000111001
Re: [slrn] Need help with score regexp
Author: Faux_Pseudo
Date: Sat, 08 Jan 2005 00:40
Date: Sat, 08 Jan 2005 00:40
39 lines
2395 bytes
2395 bytes
_.-In news.software.readers, DC wrote the following -._
> I am trying to devise a regular expression that will match x or more
> consecutive occurrences of any character, except digits.
These are all basic regexes.
> Subject: Heeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelp!
All of these are untested.
Subject: .{4,}
That will match 4 or more of anything.
Subject: [[:alnum:]]{4}
That will match any a-z and 0-9
> - 4 or more special chars like ~!@#$%^&*()-_=+[]{}|\/;:'"`<>,.?
Subject: [~!@#\$\%^&\*()-_=+\[\]{}|\\/;:'"`<>,\.\?]{4,}
I /think/ that will do it. But I may not have all the escapes that
are really needed.
> PS: A link to an excellent online reference/tutorial for writing s-lang
> regexps would be very welcome, also.
<url:www.macroexpressions.com/doc/snob/snobre.htm>
I think it might be time to rewrite the score FAQ for slrn. It is
good for basics but there should be an advanced score FAQ.
Yes, yes I know. I can write it. But not today.
--
.-')) asciipr0n.com/fp ('-. | It's a damn poor mind that
' ..- .:" ) ( ":. -.. ' | can only think of one way to
((,,_;'.;' UIN=66618055 ';. ';_,,)) | spell a word.
((_.YIM=Faux_Pseudo :._)) | - Andrew Jackson
Re: [slrn] Need help with score regexp
Author: paf the dog
Date: Sat, 08 Jan 2005 00:43
Date: Sat, 08 Jan 2005 00:43
20 lines
1471 bytes
1471 bytes
Faux_Pseudo grumbled:
> _.-In news.software.readers, DC wrote the following -._
>> I am trying to devise a regular expression that will match x or more
>> consecutive occurrences of any character, except digits.
>
> These are all basic regexes.
>
>> Subject: Heeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelp!
>
> All of these are untested.
>
> Subject: .{4,}
are such patterns part of slang regexp?
I am not sure
--
paf the dog
remove primate to reply
Re: [slrn] Need help with score regexp
Author: Faux_Pseudo
Date: Sat, 08 Jan 2005 03:44
Date: Sat, 08 Jan 2005 03:44
12 lines
1596 bytes
1596 bytes
_.-In news.software.readers, paf the dog wrote the following -._
>> Subject: .{4,}
>
> are such patterns part of slang regexp?
<url:http://www.macroexpressions.com/doc/snob/snobre.htm>
--
.-')) asciipr0n.com/fp ('-. | It's a damn poor mind that
' ..- .:" ) ( ":. -.. ' | can only think of one way to
((,,_;'.;' UIN=66618055 ';. ';_,,)) | spell a word.
((_.YIM=Faux_Pseudo :._)) | - Andrew Jackson
Re: [slrn] Need help with score regexp
Author: paf the dog
Date: Sat, 08 Jan 2005 09:29
Date: Sat, 08 Jan 2005 09:29
12 lines
1341 bytes
1341 bytes
Faux_Pseudo grumbled:
> _.-In news.software.readers, paf the dog wrote the following -._
>>> Subject: .{4,}
>>
>> are such patterns part of slang regexp?
>
><url:http://www.macroexpressions.com/doc/snob/snobre.htm>
<url:http://slrn.sourceforge.net/manual/slrn-FAQ.html#toc4.5>
--
paf the dog
remove primate to reply
Re: [slrn] Need help with score regexp
Author: paf the dog
Date: Sat, 08 Jan 2005 09:34
Date: Sat, 08 Jan 2005 09:34
15 lines
1385 bytes
1385 bytes
Faux_Pseudo grumbled:
> _.-In news.software.readers, paf the dog wrote the following -._
>>> Subject: .{4,}
>>
>> are such patterns part of slang regexp?
>
><url:http://www.macroexpressions.com/doc/snob/snobre.htm>
<url:http://slrn.sourceforge.net/manual/slrn-FAQ.html#toc4.5>
<url:http://www.s-lang.org/doc/html/slang-18.html>
:)
--
paf the dog
remove primate to reply
Re: [slrn] Need help with score regexp
Author: paf the dog
Date: Sat, 08 Jan 2005 09:36
Date: Sat, 08 Jan 2005 09:36
15 lines
1416 bytes
1416 bytes
Faux_Pseudo grumbled:
> _.-In news.software.readers, paf the dog wrote the following -._
>>> Subject: .{4,}
>>
>> are such patterns part of slang regexp?
>
><url:http://www.macroexpressions.com/doc/snob/snobre.htm>
<url:http://slrn.sourceforge.net/manual/slrn-FAQ-4.html#ss4.5>
<url:http://www.s-lang.org/doc/html/slang-18.html>
:)
--
paf the dog
remove primate to reply
Re: [slrn] Need help with score regexp
Author: Mike
Date: Sat, 08 Jan 2005 17:02
Date: Sat, 08 Jan 2005 17:02
18 lines
1393 bytes
1393 bytes
On 8 Jan 2005 09:36:45 GMT, paf the dog wrote:
> Faux_Pseudo grumbled:
>> _.-In news.software.readers, paf the dog wrote the following -._
>>>> Subject: .{4,}
>>> are such patterns part of slang regexp?
>><url:http://www.macroexpressions.com/doc/snob/snobre.htm>
><url:http://slrn.sourceforge.net/manual/slrn-FAQ-4.html#ss4.5>
><url:http://www.s-lang.org/doc/html/slang-18.html>
>:)
Was your answer yes or no?
--
Mike.
Re: [slrn] Need help with score regexp
Author: W. Citoan
Date: Sat, 08 Jan 2005 17:29
Date: Sat, 08 Jan 2005 17:29
82 lines
4362 bytes
4362 bytes
DC wrote:
> I am trying to devise a regular expression that will match x or more
> consecutive occurrences of any character, except digits.
Is there any reason to exclude digits? I guess in binary groups it
would be an issue, but in other groups it doesn't seem that it would
save many valid posts. That exclusion makes it more complicated...
The following should match 4 or more of any character...
Subject: \(.\)$1$1$1
I tested it with only 2 occurrences and it caught the double "e" in this
thread's subject line.
But if you want to exclude digits here are some ideas:
> - 4 or more of *any* letter
Subject: \([a-z]\)$1$1$1
This I also tested on using two characters (i.e. I only used one $1 in
testing). I wasn't able to find posts that contained 4 repeats.
> - 4 or more special chars like ~!@#$%^&*()-_=+[]{}|\/;:'"`<>,.?
If you want repeating characters than:
Subject: \([-~!@#$%^&*()-_=+\[\]{}|\\/;:'"`<>,.?]\)$1$1$1
If you want to match any multiple occurrence of these characters and not
just a repeating pattern (i.e. "$%^#" in addition to "####"), then the
following:
Subject: [-~!@#$%^&*()-_=+\[\]{}|\\/;:'"`<>,.?][-~!@#$%^&*()-_=+\[\]{}|\\/;:'"`<>,.?][-~!@#$%^&*()-_=+\[\]{}|\\/;:'"`<>,.?][-~!@#$%^&*()-_=+\[\]{}|\\/;:'"`<>,.?]
Now, I doubt these two will work directly as printed. Without a test
post, I was unable to check the proper escaping. Since some of those
characters have special meanings, they usually need to be escaped, but
not always when its inside []. I based it off my memory of standard
regex (but I probably made some mistakes) and I'm not sure slang is
fully the same anyway.
You might want to build this one up as you go. Start with a simple one
(like [-@#:;,.]) and add additional characters as you encounter them.
If simply adding the character doesn't work then escape it with a "\"
(like [-@#:;,.\[\]] where the brackets inside are escaped to prevent
them ending the outer brackets). The "-" must be the first character
inside the brackets or it will be interpreted as a range and not a "-".
Normal regex has a "not" operator for ranges that makes defining this
case much, much easier, but I couldn't find a reference to it in slang.
> I wish to allow digits, however, but not in this particular instance:
>
> Subject: HELP!!!!!!1!111!1!!!!!!!111!!!111111!!!!!
The following will match 1 or more numbers, followed by one or more !,
followed by one or more numbers.
Subject: [0-9]+!+[0-9]
If you want to match any punctuation character, substitute the ! with
the [] expression from the previous rules.
> PS: A link to an excellent online reference/tutorial for writing s-lang
> regexps would be very welcome, also.
I haven't found an excellent one. paf the dog already posted the only
slang regex documentation I've seen. There are some excellent tutorials
for "standard" regex. You could try reading those and only focus on the
parts that slang actually implements. A google search on regex should
pull up plenty.
If you want to point us to specific threads that you're having trouble
with, I'm willing to try helping...
- W. Citoan
--
Remember that no man loses other life than that which he lives, or lives
any other life than that which he loses.
-- Marcus Aurelius
Re: [slrn] Need help with score regexp
Author: W. Citoan
Date: Sat, 08 Jan 2005 17:33
Date: Sat, 08 Jan 2005 17:33
15 lines
1548 bytes
1548 bytes
Faux_Pseudo wrote:
> _.-In news.software.readers, paf the dog wrote the following -._
> >> Subject: .{4,}
> >
> > are such patterns part of slang regexp?
>
> <url:http://www.macroexpressions.com/doc/snob/snobre.htm
This is not s-lang documentation. This is for the PCRE regex engine.
- W. Citoan
--
Remember that no man loses other life than that which he lives, or lives
any other life than that which he loses.
-- Marcus Aurelius
Re: [slrn] Need help with score regexp
Author: paf the dog
Date: Sat, 08 Jan 2005 19:36
Date: Sat, 08 Jan 2005 19:36
22 lines
1787 bytes
1787 bytes
Mike grumbled:
> On 8 Jan 2005 09:36:45 GMT, paf the dog wrote:
>> Faux_Pseudo grumbled:
>>> _.-In news.software.readers, paf the dog wrote the following -._
>>>>> Subject: .{4,}
>
>>>> are such patterns part of slang regexp?
>
>>><url:http://www.macroexpressions.com/doc/snob/snobre.htm>
>><url:http://slrn.sourceforge.net/manual/slrn-FAQ-4.html#ss4.5>
>><url:http://www.s-lang.org/doc/html/slang-18.html>
>
>>:)
>
> Was your answer yes or no?
Faux_Pseudo's answer was yes (it is part of) and mine was no (it is not
part of). I answered the same laconic way, sorry for the weird dialog :)
--
paf the dog
remove primate to reply
Re: [slrn] Need help with score regexp
Author: »Q«
Date: Sat, 08 Jan 2005 19:57
Date: Sat, 08 Jan 2005 19:57
20 lines
2143 bytes
2143 bytes
"W. Citoan" <wcitoan@NOSPAM-yahoo.com> wrote in
<news:slrncu06av.3bg.wcitoan@wcitoan-via.supernews.com>:
>>> are such patterns part of slang regexp?
>>
>> <url:http://www.macroexpressions.com/doc/snob/snobre.htm
>
> This is not s-lang documentation. This is for the PCRE regex engine.
And once again I demand that someone post a comprehensive howto on
getting that PCRE plugin for S-Lang to work with slrn! ;)
Does anybody have a good guess on when a stable S-Lang v2 might be
released? I just read the development status page, but I can't look at
it and guess at a time frame.
--
»Q«
links to Xnews resources:
<http://www.cotse.net/users/putty/help.htm>
Re: [slrn] Need help with score regexp
Author: W. Citoan
Date: Sun, 09 Jan 2005 21:32
Date: Sun, 09 Jan 2005 21:32
18 lines
1882 bytes
1882 bytes
»Q« wrote: > > And once again I demand that someone post a comprehensive howto on > getting that PCRE plugin for S-Lang to work with slrn! ;) I'm sure someone will get right on it... > Does anybody have a good guess on when a stable S-Lang v2 might be > released? I just read the development status page, but I can't look at > it and guess at a time frame. The alt.lang.s-lang group would probably be a better place to ask. - W. Citoan -- My center is giving way, my right is in retreat, situation excellent. I attack! -- [General] Ferdinand Foch
Re: [slrn] Need help with score regexp
Author: DC
Date: Sat, 19 Mar 2005 22:47
Date: Sat, 19 Mar 2005 22:47
44 lines
2698 bytes
2698 bytes
Faux_Pseudo wrote:
> _.-In news.software.readers, DC wrote the following -._
>> I am trying to devise a regular expression that will match x or more
>> consecutive occurrences of any character, except digits.
> These are all basic regexes.
>> Subject: Heeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelp!
> All of these are untested.
> Subject: .{4,}
> That will match 4 or more of anything.
> Subject: [[:alnum:]]{4}
> That will match any a-z and 0-9
>> - 4 or more special chars like ~!@#$%^&*()-_=+[]{}|\/;:'"`<>,.?
> Subject: [~!@#\$\%^&\*()-_=+\[\]{}|\\/;:'"`<>,\.\?]{4,}
> I /think/ that will do it. But I may not have all the escapes that
> are really needed.
Thanks, I'll have a look at these. Sorry I took so long to get back to
you. I accidentally marked your message read and forgot about it. }:O)
>> PS: A link to an excellent online reference/tutorial for writing s-lang
>> regexps would be very welcome, also.
><url:www.macroexpressions.com/doc/snob/snobre.htm>
> I think it might be time to rewrite the score FAQ for slrn. It is
> good for basics but there should be an advanced score FAQ.
> Yes, yes I know. I can write it. But not today.
Aw.
--
DC Linux RU #1000111011000111001
Customize Xnews - http://dcicons.fateback.com
Re: [slrn] Need help with score regexp
Author: DC
Date: Sat, 19 Mar 2005 22:49
Date: Sat, 19 Mar 2005 22:49
84 lines
4893 bytes
4893 bytes
W. Citoan wrote:
> DC wrote:
>> I am trying to devise a regular expression that will match x or more
>> consecutive occurrences of any character, except digits.
> Is there any reason to exclude digits? I guess in binary groups it
> would be an issue, but in other groups it doesn't seem that it would
> save many valid posts. That exclusion makes it more complicated...
> The following should match 4 or more of any character...
> Subject: \(.\)$1$1$1
> I tested it with only 2 occurrences and it caught the double "e" in this
> thread's subject line.
> But if you want to exclude digits here are some ideas:
>> - 4 or more of *any* letter
> Subject: \([a-z]\)$1$1$1
> This I also tested on using two characters (i.e. I only used one $1 in
> testing). I wasn't able to find posts that contained 4 repeats.
>> - 4 or more special chars like ~!@#$%^&*()-_=+[]{}|\/;:'"`<>,.?
> If you want repeating characters than:
> Subject: \([-~!@#$%^&*()-_=+\[\]{}|\\/;:'"`<>,.?]\)$1$1$1
> If you want to match any multiple occurrence of these characters and not
> just a repeating pattern (i.e. "$%^#" in addition to "####"), then the
> following:
> Subject: [-~!@#$%^&*()-_=+\[\]{}|\\/;:'"`<>,.?][-~!@#$%^&*()-_=+\[\]{}|\\/;:'"`<>,.?][-~!@#$%^&*()-_=+\[\]{}|\\/;:'"`<>,.?][-~!@#$%^&*()-_=+\[\]{}|\\/;:'"`<>,.?]
> Now, I doubt these two will work directly as printed. Without a test
> post, I was unable to check the proper escaping. Since some of those
> characters have special meanings, they usually need to be escaped, but
> not always when its inside []. I based it off my memory of standard
> regex (but I probably made some mistakes) and I'm not sure slang is
> fully the same anyway.
> You might want to build this one up as you go. Start with a simple one
> (like [-@#:;,.]) and add additional characters as you encounter them.
> If simply adding the character doesn't work then escape it with a "\"
> (like [-@#:;,.\[\]] where the brackets inside are escaped to prevent
> them ending the outer brackets). The "-" must be the first character
> inside the brackets or it will be interpreted as a range and not a "-".
> Normal regex has a "not" operator for ranges that makes defining this
> case much, much easier, but I couldn't find a reference to it in slang.
>> I wish to allow digits, however, but not in this particular instance:
>> Subject: HELP!!!!!!1!111!1!!!!!!!111!!!111111!!!!!
> The following will match 1 or more numbers, followed by one or more !,
> followed by one or more numbers.
> Subject: [0-9]+!+[0-9]
> If you want to match any punctuation character, substitute the ! with
> the [] expression from the previous rules.
>> PS: A link to an excellent online reference/tutorial for writing s-lang
>> regexps would be very welcome, also.
> I haven't found an excellent one. paf the dog already posted the only
> slang regex documentation I've seen. There are some excellent tutorials
> for "standard" regex. You could try reading those and only focus on the
> parts that slang actually implements. A google search on regex should
> pull up plenty.
> If you want to point us to specific threads that you're having trouble
> with, I'm willing to try helping...
Thanks for all of that. Much testing to do. }:O)
--
DC Linux RU #1000111011000111001
Customize Xnews - http://dcicons.fateback.com
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