possible to use variable to represent regexp's matchVars ?



Hi,

I'm maintaining parsing script that parses output from a firmware uart. The syntax I'm using is

regexp $regex $line -> matchVar1 matchVar2 matchVar3 ...


The RE $regex change base on $line. So for different fw version, I would assign $regex different.

I'm having trouble maintaining the matchVar, since they would change from version to version.

So is it possible instead to use regexp like this? If so, what's the proper syntax?

set matchVar [list matchVar1 matchVar2 matchVar3]
regexp $regex $line -> $matchVar
(I know this syntax won't work)


Thanks
.