Sublime Forum

TCL regsub causing syntax issues

#1

Hello,

I write quite a few scripts where I have to browse for files on my computer but need all of the \ in the file path to be facing the other way (/). I use a regsub command for this:

 regsub -all {\\} $file_path {/} file_path 

but what happens is that everything in the script after the } reverts to plain text, all of my brackets are unclosed, etc. the \ seems to escape the TCL Syntax in Sublime.

All that being said, the script runs just fine. It just makes it really hard to write anything afterwards. What I have done up to now was put the line in, comment it out and then uncomment it when I’m done, but I’m hoping there might be an easier fix. Either an alternative to the command itself that would do the same thing or a way to fix the syntax.

Thank you for any advice.

0 Likes