mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2003
Posts: 18
M
Maveric Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Mar 2003
Posts: 18
How do you count the number of control codes someone used in a message WITHOUT having to strip it in the mIRC options and using $stripped?? That seems to be the only way I can get results, but I don't want to strip all the messages.

Joined: May 2003
Posts: 730
S
Hoopy frood
Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
if u mean control codes by ALL control codes that is chr 1-31 too so u can use $regex($1-,/[[:cntrl]]/g)
and if u want just color,bold,underline,reverse
u can use $calc($len($1-) - $len($strip($1-)))

Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
You missed a colon : in $regex($1-,/[[:cntrl:]]/g)

Joined: May 2003
Posts: 730
S
Hoopy frood
Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
oops, yeah, thx

Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Maybe I'm missing something, but why is it /[[:cntrl:]]/g and not just /[:cntrl:]/g ?

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
This is how man.txt describes it,

     "Perl supports the POSIX notation for character classes,
     which uses names enclosed by [: and :] within the enclosing
     square brackets."

Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Ah ok, it's just PCRE/Perl deciding not to follow the POSIX standard for regular expressions...

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
If you just want to count the number of instances of BURC, the oldskool method is simply: $count($1-,$chr(2),$chr(31),$chr(22),$chr(3))

If you want to get into counting opening but not closing control codes, then a regular expression should be appropriate.

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard