mIRC Home    About    Download    Register    News    Help

Print Thread
#145642 25/03/06 06:19 PM
Joined: Mar 2006
Posts: 13
Z
zkx Offline OP
Pikka bird
OP Offline
Pikka bird
Z
Joined: Mar 2006
Posts: 13
oh so basicly i can't figure out how to check if a line has a damn comma in it... with regex

or basicly 0,0 or 00,00 i can match anything else besides the comma, even if i use like
var %y = /(,)/g or var %y = /([,])/g

or anything else i could think of
i've been told that in perl some of the stuff i've tried should work....

so what works in mirc? mad

#145643 25/03/06 06:37 PM
Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
var %c = $+(/,$chr(44),/)
if ($regex($1,%c)) { echo -a There is a comma }

#145644 25/03/06 07:14 PM
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
whenever you wrap something in parentheses in an identifier, it's treated as plaintext.. commas included laugh so your /(,)/g example should've worked (both in $regex() itself, and in the variable as you had it):

//var %string = bla, bla, bla | echo -a $regex(%string,/(,)/g)

or you can use a hex escape such as /\x2C/g or octal: /\054/g (or /\54/g)


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
#145645 26/03/06 12:21 PM
Joined: Mar 2006
Posts: 13
Z
zkx Offline OP
Pikka bird
OP Offline
Pikka bird
Z
Joined: Mar 2006
Posts: 13
ah, it was actually because i was using an $identifier to test it so the comma magically disappeared :P
so i had to test with //var %h bruuhaahaa 0,0fuffaafaa | $regex2(%h)

silly me

Last edited by zkx; 26/03/06 12:44 PM.

Link Copied to Clipboard