Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

regexp question

Status
Not open for further replies.

Miami80

Programmer
Apr 6, 2012
2
US
Hello all,

I am new here, and I am new with TCL as well. I like all the tools that TCL has, and I was attempting to use regexp or string match to do the following.

I have a file name "80-40-XXYY" where XX are numbers from 0-9 and YY are letter from A-Z (case sensitive).

I tried:

string match "*80-40-[0-9][0-9][A-Z][A-Z]", but I get an error for unknown command "0-9"...

I also tried regexp with the same format, but I get the same error... can anyone please help me with the correct format? I saw some similar questions but none that I could correctly apply. Also, if anyone can tell me if its better to use regexp or string match for this comparison, that would be greatly appreciated as well. Thanks!
 
I got it! Needed to do /[90/] so that TCL wouldn't take the [..] as commands.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top