Forum Discussion
nitass_89166
Aug 29, 2013Noctilucent
is tcl scan useful?
e.g.
% set test1 "10.10.10.10%1"
10.10.10.10%1
% set test123 "10.10.10.10%123"
10.10.10.10%123
% scan $test1 {%[^%%]%%%d} a b
2
% put $a
10.10.10.10
% put $b
1
% scan $test123 {%[^%%]%%%d} a b
2
% put $a
10.10.10.10
% put $b
123
%
- AurelAug 29, 2013CirrusYes Nitass, this is doing the job fine. That's seems fine. As Kevin said, it looks that is using regex and then will consume CPU a little more than "tcl native" commands. Am i right ? I'd like (as far as possible) to do this with the fewest impact on performance.
- nitass_89166Aug 29, 2013Noctilucentyes, that is correct. :-)
- nitass_89166Aug 29, 2013Noctilucentoops sorry, i misread. scan command does not use regex.