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!

matching a pattern

Status
Not open for further replies.

ramsunder

Programmer
Sep 3, 2003
9
DE
Hi,
I can have a list like:

set list1 "0055 888 889 3330"
set list2 "55 888 889 3330"
set list3 "5500 888 889 3330"
set list4 "655 888 889 3330"
set list5 "550 888 889 3330"

and a variable 55, say:
set var 55

I want to write one lserach statement, if I search my variable in above list the results for each corresponding list must be:

lsearch Result for:
list1>> 0
list2>> 0
list3>> -1
list4>> -1
list5>> -1

Can any one please help in writing such lsearch.

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top