possible to use variable to represent regexp's matchVars ?
- From: py <pyjunk@xxxxxxx>
- Date: Tue, 22 May 2012 21:54:51 +0300
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
.
- Follow-Ups:
- Re: possible to use variable to represent regexp's matchVars ?
- From: Glenn Jackman
- Re: possible to use variable to represent regexp's matchVars ?
- From: Andreas Leitgeb
- Re: possible to use variable to represent regexp's matchVars ?
- From: Alexandre Ferrieux
- Re: possible to use variable to represent regexp's matchVars ?
- Prev by Date: Re: TCOM: Referencing cols with numbers instead of letters
- Next by Date: Re: using tdom to find duplicate child node names
- Previous by thread: using tdom to find duplicate child node names
- Next by thread: Re: possible to use variable to represent regexp's matchVars ?
- Index(es):