I am trying to write a Tcl script in which I need to match a variable in a regular expression.
For instance, file has some lines of code containing ‘major’. Out of all these lines I need to identify one particular line:
major("major",0x32)
I m using variable p1 for ‘major’ (set p1 major)
How can I write a regexp using variable p1 ($p1) to capture that particular line?
In tclsh: