I was trying to figure out how to remove curly braces from a string in TCL.
I ran across thread287-1105238 which stated that one user tried the following and it didn't work:
regsub -all {[\{]} $sToken "" sToken
but another user did have the above work.
My TCL intepreter did not work with the above, but the following did work for me ... and I wanted to remove the left and right curly brace anyway.
regsub -all {[\{|\}]} $sToken "" sToken
The right curly brace allowed the TCL interpreter to see it as a valid construct and the execution was as expected.
finale(tcl)> set sToken "{{something}}"; echo $sToken
{{something}}
finale(tcl)> regsub -all {[\{|\}]} $sToken "" sToken; echo $sToken
something
Hope that helps someone else.
Bill
I ran across thread287-1105238 which stated that one user tried the following and it didn't work:
regsub -all {[\{]} $sToken "" sToken
but another user did have the above work.
My TCL intepreter did not work with the above, but the following did work for me ... and I wanted to remove the left and right curly brace anyway.
regsub -all {[\{|\}]} $sToken "" sToken
The right curly brace allowed the TCL interpreter to see it as a valid construct and the execution was as expected.
finale(tcl)> set sToken "{{something}}"; echo $sToken
{{something}}
finale(tcl)> regsub -all {[\{|\}]} $sToken "" sToken; echo $sToken
something
Hope that helps someone else.
Bill