Page 1 of 1

Noobish RegExp question with ^

Posted: Sat Oct 27, 2007 4:56 am
by KalleL
Hello,

I'm sorry, this is really a stupid question. I've tried to look regex tutorials to solve this one, but no luck.

So I've played with a script that queries gameserver (Enemy Territory: Quake Wars) and echos server status, players etc. But now server name and players are having color codes in their names. Color codes are like ^1,^2,^3 ... ^9 and ^a to ^z. So basicly I would need to parse these off the string: like this: ^[1-9a-z] or something like that.

Anyone to help this little newbie? :oops:

Posted: Sat Oct 27, 2007 6:49 am
by VladSun
^ symbol is a special symbol - it means "the begining of the line". Thus, you need to escape it like this: \^ in your regexp.