mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2003
Posts: 9
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Nov 2003
Posts: 9
For example if i have many strings of the type strXX(X,X,X..X)
str100 , str2432 , str12414 ... and so on.

so my question is how can i replace those strings with string of the type $mircdir\(the number)\(the number).txt

i hope that i explained it right because my english is not very good

Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
If that string is in the variable %text and it's always "str" with some numbers behind it:
if ($regex(%text,^[color:brown]str(\d+)$) var %newstring = $+($mircdir,$regml(1),\,$regml(1),.txt)[/color]
or
if ($remove(%text,[color:brown]str) isnum 0-) %newstring = $+($mircdir,$v1,\,$v1,.txt)[/color]

If the "str" part can change too and you want to skip everything but the numbers:
if ($regex(%text,(\d+)) var %newstring = $+($mircdir,$regml(1),\,$regml(1),.txt)

If it's always 3 chraracters you want to skip:
if ($right(%text,-3) isnum 0-) %newstring = $+($mircdir,$v1,\,$v1,.txt)


Link Copied to Clipboard