mIRC Homepage
Posted By: stAkeR regular expression little problem - 10/02/05 12:38 AM
Hi everyone, heres what im trying to do and what is not working:

so lets say i have a string: ^3first^ase cond^lLa^St

now i can make separated string like ^3first then ^ase cond but i cant have my 3rd string wich should be: ^lLa^St

anyone got a solution?
Posted By: DaveC Re: regular expression little problem - 10/02/05 03:39 AM
If im missing something this has to do with regex's im sorry, but you should be able to get that from

var %string1 = ^ $+ $gettok(%text,1,94)
var %string2 = ^ $+ $gettok(%text,2,94)
var %string3 = ^ $+ $gettok(%text,3-,94)

Im adding the first ^ since it gets eaten as the lead token seperator

Note 94 is the asc value of the ^ character
Posted By: stAkeR Re: regular expression little problem - 10/02/05 04:25 AM
ya i know i can work with tokens but its maybe 5times faster working with the regular expressions considering this is just a small part of what im doing

but is there any documentations about the regular expressions options for irc ones, like alternations characters
Posted By: Hammer Re: regular expression little problem - 10/02/05 10:41 PM
We'll just assume you know what you're talking about with respect to your comment on $regex working faster than ANY built-in mIRC $identifier and assume that you have reasons to believe that.

The regular expression syntax would be: /^(\^.*?)(\^.*?)(\^.*)$/

//.echo -q $regex(^3first^ase cond^lLa^St, /^(\^.*?)(\^.*?)(\^.*)$/) | echo -s 1: $regml(1) | echo -s 2: $regml(2) | echo -s 3: $regml(3)

1: ^3first
2: ^ase cond
3: ^lLa^St
© mIRC Discussion Forums