I want to parse some data, looking for a specific pattern. There can
be multiple matches on a line and I can never know ahead of time how
many there will be. What is the best way to get them all? Is it by
something like this:
while {[regexp -indices $pattern $data indices]} {
set found [string range $data [lindex $indices 0] [lindex $indices
1]
set data [string range [lindex $indices 1] end]
}
or is there a better way?
L
How about [regexp -inline -all $pattern $data] or [regexp -inline -all
-indices $pattern $data]?