mIRC Home    About    Download    Register    News    Help

Print Thread
regular expression little problem #110724 10/02/05 12:38 AM
Joined: Sep 2004
Posts: 5
S
stAkeR Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Sep 2004
Posts: 5
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?

Re: regular expression little problem #110725 10/02/05 03:39 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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

Re: regular expression little problem #110726 10/02/05 04:25 AM
Joined: Sep 2004
Posts: 5
S
stAkeR Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Sep 2004
Posts: 5
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

Re: regular expression little problem #110727 10/02/05 10:41 PM
Joined: Dec 2002
Posts: 1,321
H
Hammer Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
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


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C