regsub help



The follwing doesnot work and I would like to have a work around


set line "This is a test line to demo the use of regsub"
# Replace demo with demonstrate.. here I am doing it by concatenating
'demo' and 'nstrate' ...
regsub {.*(demo).*} $line {\1nstrate} n_line


This can be done by
regsub {\sdemo\s} $line demonstrate n_line
But this is not wat i want I want a solution to make this kind of
things work ----- {\1nstrate}

Regards
Cloud

.



Relevant Pages