This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

string match not working

Old posts that have not been replied to for several years.
Locked
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

string match not working

Post by TurboChicken »

i got a string match that isn't working....

string match -nocase "200- \[*" $line"

Code: Select all

200-     __  _______  _   __________  ______  ____ _       ___   __ 
200-    /  |/  / __ \/ | / /_  __/ / / / __ \/ __ \ |     / / | / / 
200-   / /|_/ / / / /  |/ / / / / /_/ / / / / / / / | /| / /  |/ / 
200-  / /  / / /_/ / /|  / / / / __  / /_/ / /_/ /| |/ |/ / /|  / 
200- /_/  /_/\____/_/ |_/ /_/ /_/ /_/_____/\____/ |__/|__/_/ |_/ 
200- 
200-   ## User         Tagline                  Files   Amount     Speed 
200- [ 1] user1        no tagline                6395     242.6GB    - k/s 
200- [ 2] user2          no tagline                5908     221.1GB  7.4GB/s 
200- [ 3] user3        no tagline                4167     198.8GB    - k/s 
200 
coz all i want is the user1 user2 user3 lines but it doesn't seem to be working.

have i made a newb mistake?
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

hmmm kind of. but its not easy to find :D. You need to double escape [ because [] has also a special meaning for string match.
string match -nocase "200- \\\[*" $line
should do fine.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

Post by TurboChicken »

thanks dude... i got told a different way too

Code: Select all

{200- \[*}
but thanks for the effort
Locked