You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When doing a Replace in a selection that has a string with double backslashes, the Replace command will change the double backslashes to single backslashes even though something completely different is being replaced.
What steps will reproduce the problem?
Example code:
a = 1
b = 2
c = a+b
s = "C:\\Test\\Test2\\output.txt"
Mark the example code and replace selection a with x
The output will be this:
x = 1
b = 2
c = x+b
s = "E:\Test\Test2\output.txt"
What is the expected output?
x = 1
b = 2
c = x+b
s = "E:\\Test\\Test2\\output.txt"
Please provide any additional information below
It only happens on Replace selection, not when doing Replace all.
This becomes even more of a problem considering raw strings. While adding \ to the current reg-exp would solve this particular issue, it will still break on lines like:
b = r'\a\v\b'
Now, one may think that since all the escaped characters in the reg-exp are non-letters one can simply add all letters (and numbers). However, in e.g. SymPy, there is LaTeX printing, so a line in the editor may very well look like
r'\{7 \& 8\}'
If it wasn't for the word option, one could simply use subs instead for queries that are not regular expressions. Right now, I do not really have any idea how to deal with it...
Description of your problem
When doing a Replace in a selection that has a string with double backslashes, the Replace command will change the double backslashes to single backslashes even though something completely different is being replaced.
What steps will reproduce the problem?
a
withx
What is the expected output?
Please provide any additional information below
It only happens on Replace selection, not when doing Replace all.
Versions and main components
Dependencies
IPython >=4.0 : 6.2.1 (OK)
cython >=0.21 : 0.27.3 (OK)
jedi >=0.9.0 : 0.11.1 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
numpy >=1.7 : 1.13.3 (OK)
pandas >=0.13.1 : 0.22.0 (OK)
pycodestyle >=2.3: 2.3.1 (OK)
pyflakes >=0.6.0 : 1.6.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.8.1 (OK)
qtconsole >=4.2.0: 4.3.1 (OK)
rope >=0.9.4 : 0.10.7 (OK)
sphinx >=0.6.6 : 1.6.6 (OK)
sympy >=0.7.3 : 1.1.1 (OK)
The text was updated successfully, but these errors were encountered: