I can't seem to figure out how to escape \t in the replace dialog. I'm working on a latex file and needed to replace a string with "\times" but that inserts "<tab>imes" and "\\times" inserts "\<tab>imes". So, how does one escape slash-chars?
Thanks,
Nathaniel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry for the confusion, my last post was in response to "and without regular expression checked, how would you insert a tab?"
For those of you who are more in tune with the development side of Notepad++, does this appear to be a bug in Scintilla? It appears to be a bug, regardless, as \\t should produce a \t in the replaced text and not a \TAB.
Possibly this has been addressed in an updated version of Scintilla (latest is 1.75), so you might try asking over on their forum (if they have one) to see if there is another way to tackle this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the advanced Find/Replace, if regex is disabled, you can use control+I or control+M wherever you want a tab or newline in the find or replace string.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the responses guys, but several of you are misunderstanding what I'm trying to do. I want to search using regex and replace with text that contains a literal "\t", a backslash followed by the letter T.
The intuitive (at least to programmers) way of doing this is that "\\" is a literal backslash and it won't escape things, i.e. "\\t" would turn into "\t" not "\<tab>" when the search and replace was done.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I can't seem to figure out how to escape \t in the replace dialog. I'm working on a latex file and needed to replace a string with "\times" but that inserts "<tab>imes" and "\\times" inserts "\<tab>imes". So, how does one escape slash-chars?
Thanks,
Nathaniel
Sorry for the confusion, my last post was in response to "and without regular expression checked, how would you insert a tab?"
For those of you who are more in tune with the development side of Notepad++, does this appear to be a bug in Scintilla? It appears to be a bug, regardless, as \\t should produce a \t in the replaced text and not a \TAB.
Possibly this has been addressed in an updated version of Scintilla (latest is 1.75), so you might try asking over on their forum (if they have one) to see if there is another way to tackle this?
If you don't need regular expressions for this particular search and replace, unchecking "Regular Expression" should get you going.
I am using regular expressions.
In particular, searching for:
(\d+\.\d+)x\$10^\{(\d+)\}\$
wanting to replace with:
$\1\\times10^{\2}$
Thanks for the reply though.
interesting problem (trying to use \t in the replace)
there's probably no way to do it - without checking regular expression - and without regular expression checked, how would you insert a tab?
i think there's (usually) nothing wrong with doing "two part" find and replaces
Perhaps this is another nice opportunity for someone to promote their Simple Script Plug-In?
without checking -----> (i meant) without UNchecking
There is a way to insert a tab without using Regex :-)
In the text, hit the TAB key to temporarily create a tab, highlight the tab and copy to the clipboard.
Then delete it, bring up the search and replace and in the replace field, paste the tab character where ever you need it.
Works great, although it's a hokie way to do it.
So, can we also do an "undo-like" behavior for that?
That is to say, I believe the original question was how to NOT insert a tab, but the plain text "\t", while using a regex to find it.
In the advanced Find/Replace, if regex is disabled, you can use control+I or control+M wherever you want a tab or newline in the find or replace string.
Thanks for the responses guys, but several of you are misunderstanding what I'm trying to do. I want to search using regex and replace with text that contains a literal "\t", a backslash followed by the letter T.
The intuitive (at least to programmers) way of doing this is that "\\" is a literal backslash and it won't escape things, i.e. "\\t" would turn into "\t" not "\<tab>" when the search and replace was done.
I downloaded the latest version of SciTE (Scintilla's demo text editor) based on Scintilla 1.75 and it exhibits the exact same behavior.
search: times
replace: \\times
expected output: \times
actual output: \ imes
I'd recommend opening a bug with Scintilla as it will eventually propagate to Notepad++.