mIRC Home    About    Download    Register    News    Help

Print Thread
#26327 27/05/03 06:23 AM
Joined: Jan 2003
Posts: 127
L
Vogon poet
OP Offline
Vogon poet
L
Joined: Jan 2003
Posts: 127
if ($regex(netadd,$line(@loadnets,%i),^n\d+=(.*).+SERVER:(.*)GROUP:(.+))) { echo net is $regml(netadd,1) }

if line 1 is as follow
n0=Random US DALnet serverSERVER:irc.dal.net:6660-6667GROUP:01

The echo result show only "Random US DALnet serve"
The last character 'r' is miss out. What's wrong?

#26328 27/05/03 07:32 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
The last letter is omitted, because otherwise the pattern will not match the text.

n\d+=(.*).+SERVER:(.*)GROUP:(.+)

The red part requires at least one char. That's why the "r" is taken from the prior wildcard. You can either remove the .+ part, or replace it with a .*.

#26329 27/05/03 09:48 PM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
right, I would remove the .+ you highlighted. I would also replace the two .* with .+... and the final .+ (for group) with a .* because there doesn't HAVE to be a group, and might be 0 characters. (+ = 1 or more, * = 0 or more)

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard