I want to output a list like:
operation1 = [
'command\s+[0-9]+',
]
Where the pattern [0-9]+ is to be dynamically filled.
So I wrote:
reg = {
'NUMBER' : '^[0-9]+$',
}
operation1 = [
'command\s+'+str(reg[NUMBER]),
]
print operation1
But i am getting an error:
Message File Name Line Position
Traceback
<module> <module1> 6
NameError: name 'NUMBER' is not defined
Help needed! Thanks in advance.