% info patchlevel
8.3.1
% join [regexp -all -inline {[^0-9]+} "abcd12efghi34j5k6l789mnop0"] {}
abcdefghijklmnop
The 'regexp -all -inline' will return a tcl list of all substrings that don't
contain [0-9]. Then the resulting list is joined together into a string.
There are many ways to do this in tcl, and this is just one of them.
> Also i'd like to know how to access the Tcl manual under linux, it asks me
> for a page number
When you are looking for tcl or tk commands do:
man n clock
or
man n list
If your MANPATH is set up right (so that the man pages are found in the man path) then
this should work for all of the tcl and tk commands.
The C library commands are found in section 3:
man 3 Tcl_NewObj
--Dan
regsub -all {[^0-9]+} $string {} newstring
--
Jeffrey Hobbs The Tcl Guy
hobbs at ajubasolutions.com Ajuba Solutions (née Scriptics)
The first one puts all the digits in string2
The second puts all the non-digits there
regsub -all -- {[^\d]+} $string1 {} string2
regsub -all -- {\d+} $string1 {} string2