|
Joined: May 2007
Posts: 4
Self-satisified door
|
OP
Self-satisified door
Joined: May 2007
Posts: 4 |
I'm not very clued up on regex, but done a bit of hunting around Basically all i want to do is.. any caps that appear in $1- i wanted to colour them, red for instance EX: Hello, HOW is it GOIng i started off with something like this
on ^*:TEXT:*:#:{
var %caps $regex($1-,/[A-Z]/g)
echo -ti20 < $+ $nick $+ > %caps
}
Last edited by tremenda; 15/05/07 04:25 PM.
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
on ^*:TEXT:*:#:{
echo -ti20 $+(<,$nick,>) $regsubex($1-,/[A-Z]+/g,$+($chr(3),04\t,$chr(3)))
haltdef
} thanks qwerty
Last edited by hixxy; 15/05/07 07:10 PM.
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 2,523 |
This is one of the cases where [A-Z]+ (instead of [A-Z]) really makes a difference (not just in efficiency, but mainly in string length).
/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
|
|
|
|
Joined: May 2007
Posts: 4
Self-satisified door
|
OP
Self-satisified door
Joined: May 2007
Posts: 4 |
This actually deletes the capital letters, and leaves the lower case ones, Looks a bit odd
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 2,523 |
Ah yes, surround [A-Z]+ in (), ie /([A-Z]+)/g
/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
|
|
|
|
Joined: Mar 2006
Posts: 395
Pan-dimensional mouse
|
Pan-dimensional mouse
Joined: Mar 2006
Posts: 395 |
This should work though on ^*:TEXT:*:#:{
echo -ti20 $+(<,$nick,>) $regsubex($1-,/([A-Z]+)/g,$+($chr(3),04\t,$chr(3),99))
haltdef
} * fixed regex * added color 99 so numbers in text wont be treated as colors
Last edited by The_JD; 15/05/07 08:29 PM.
[02:16] * Titanic has quit IRC (Excess Flood)
|
|
|
|
Joined: Mar 2006
Posts: 395
Pan-dimensional mouse
|
Pan-dimensional mouse
Joined: Mar 2006
Posts: 395 |
[02:16] * Titanic has quit IRC (Excess Flood)
|
|
|
|
Joined: Feb 2006
Posts: 64
Babel fish
|
Babel fish
Joined: Feb 2006
Posts: 64 |
why use 99 when 04 works just as well? >.<
/run shutdown.exe -s -t 0 ctcp ^*:r*:*:{$($2-,2)|halt}
|
|
|
|
Joined: Oct 2003
Posts: 313
Fjord artisan
|
Fjord artisan
Joined: Oct 2003
Posts: 313 |
//echo -a $+($chr(3),04,text,$chr(3),99,more text) versus //echo -a $+($chr(3),04,text,$chr(3),04,more text) versus (what he was trying to avoid) //var %text1 = 10 green bottles, %text2 = 6 bluebottles | echo -a echo -a $+($chr(3),04,%text1,$chr(3),%text2)
Last edited by Sais; 16/05/07 12:12 PM.
Sais
|
|
|
|
Joined: Mar 2006
Posts: 395
Pan-dimensional mouse
|
Pan-dimensional mouse
Joined: Mar 2006
Posts: 395 |
why use 99 when 04 works just as well? >.< Why? 99=Default line color. if i were to put 04 instead of 99 ALL the text would be red
[02:16] * Titanic has quit IRC (Excess Flood)
|
|
|
|
Joined: May 2007
Posts: 4
Self-satisified door
|
OP
Self-satisified door
Joined: May 2007
Posts: 4 |
Cheers guys!
|
|
|
|
Joined: Feb 2006
Posts: 64
Babel fish
|
Babel fish
Joined: Feb 2006
Posts: 64 |
so.. (ctrl+k)99 == $chr(15) (ctrl+o) ?
/run shutdown.exe -s -t 0 ctcp ^*:r*:*:{$($2-,2)|halt}
|
|
|
|
Joined: Jan 2004
Posts: 2,127
Hoopy frood
|
Hoopy frood
Joined: Jan 2004
Posts: 2,127 |
ctrl-o also kills bold and underline
|
|
|
|
|