This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
Dedan
Master
Posts: 260 Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis
Post
by Dedan » Wed Aug 13, 2003 5:54 am
I have tried many different combinations,
but i can not find the right ones.
the snipplet is suppost to count the codes
Code: Select all
set codes(found) [regexp -all {(002) (003) (037)} $text]
thanks for any help given
I once was an intelligent young man, now i am old and i can not remember who i was.
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Wed Aug 13, 2003 5:57 am
Code: Select all
regexp -all {\002|\003|\037} $text
or
Code: Select all
regexp -all {[\002\003\037]} $text
Last edited by
user on Wed Aug 13, 2003 6:09 am, edited 1 time in total.
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Wed Aug 13, 2003 6:02 am
instead of \003 it should be \003[0-9]{0,2}(,[0-9]{0,2})? I think due the *variables* it has like: 2,4 or 2, etc. A simple test should reveal If I'm right or wrong.
Once the game is over, the king and the pawn go back in the same box.
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Wed Aug 13, 2003 6:08 am
caesar wrote: instead of \003 it should be \003[0-9]{0,2}(,[0-9]{0,2})? I think due the *variables* it has like: 2,4 or 2, etc. A simple test should reveal If I'm right or wrong.
I don't think he cares what color's used
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Wed Aug 13, 2003 6:10 am
Oups, yes, he only wants to count 'em
Once the game is over, the king and the pawn go back in the same box.
Dedan
Master
Posts: 260 Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis
Post
by Dedan » Wed Aug 13, 2003 6:17 am
how would i look for spaces?
i tried:
Code: Select all
set spaces(found) [regexp -all {" "} $text]
puthelp "PRIVMSG $chan :spaces(found) is $spaces(found)"
thanks for the "codes" help, it works like a charm
I once was an intelligent young man, now i am old and i can not remember who i was.
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Wed Aug 13, 2003 6:35 am
Dedan wrote: Code: Select all
set spaces(found) [regexp -all {" "} $text]
The quotes between the braces are taken litterally, so your rule would match quote-space-quote. Get rid of the quotes and it'll work just fine
Dedan
Master
Posts: 260 Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis
Post
by Dedan » Wed Aug 13, 2003 7:00 am
works great, thanks.
1 more question
how can i get " [ ] " into a channel msg?
Code: Select all
puthelp "PRIVMSG $chan :[exp/too many codes]"
puthelp "PRIVMSG $chan :{[exp/too many codes]}"
puthelp "PRIVMSG $chan :"[exp/too many codes]""
all 3 do not work
[06:51] Tcl error [protect:channel]: invalid command name "exp/too"
[06:53] Tcl error [protect:channel]: extra characters after close-quote
I once was an intelligent young man, now i am old and i can not remember who i was.
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Wed Aug 13, 2003 7:36 am
\[\]
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Wed Aug 13, 2003 7:40 am
Only the [ must be .. umm.. forgot the word
basicaly it should be \[]
Once the game is over, the king and the pawn go back in the same box.
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Wed Aug 13, 2003 7:42 am
caesar wrote: Only the [ must be .. umm.. forgot the word
basicaly it should be \[]
Yes, but escaping the "]" doesn't hurt and will prevent confusing behaviour if you have an unterminated "[" some place before the unescaped "]"
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Wed Aug 13, 2003 7:58 am
Umm.. if you are carefully then there should not be a problem, but basicaly yes, is nice to *escape* them..
Once the game is over, the king and the pawn go back in the same box.
Dedan
Master
Posts: 260 Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis
Post
by Dedan » Wed Aug 13, 2003 8:05 am
Thanks for all the Help
I once was an intelligent young man, now i am old and i can not remember who i was.