I am using TCL8.4. In the following expression, I tried to get a numerical value using ([0-9] +). But this is not as much as possible, although the “+” is displayed on the man page, designed to match as much as possible (ref: http://wiki.tcl.tk/396 ) Also, please share / suggest the best way to do that what i want to do.
%set a {
NOTPLD STATS:
Bps: 0; pps: 0; Bytes: 0; Packets: 4535
TPLD STATS:
Bps: 0; pps: 0; Bytes: 0; Packets: 4535
}
%
% regexp {NOTPLD STATS:(.*?)Packets:[\s]+([0-9]+)} $a t1 t2 c
1
% set c
4
source
share