{"action":"created","issue":{"url":"https://api.github.com/repos/bruderstein/PythonScript/issues/30","repository_url":"https://api.github.com/repos/bruderstein/PythonScript","labels_url":"https://api.github.com/repos/bruderstein/PythonScript/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/bruderstein/PythonScript/issues/30/comments","events_url":"https://api.github.com/repos/bruderstein/PythonScript/issues/30/events","html_url":"https://github.com/bruderstein/PythonScript/issues/30","id":202349381,"number":30,"title":"editor.rereplace() not escaping backslash ","user":{"login":"jzajac2","id":101703,"avatar_url":"https://avatars1.githubusercontent.com/u/101703?v=4","gravatar_id":"","url":"https://api.github.com/users/jzajac2","html_url":"https://github.com/jzajac2","followers_url":"https://api.github.com/users/jzajac2/followers","following_url":"https://api.github.com/users/jzajac2/following{/other_user}","gists_url":"https://api.github.com/users/jzajac2/gists{/gist_id}","starred_url":"https://api.github.com/users/jzajac2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzajac2/subscriptions","organizations_url":"https://api.github.com/users/jzajac2/orgs","repos_url":"https://api.github.com/users/jzajac2/repos","events_url":"https://api.github.com/users/jzajac2/events{/privacy}","received_events_url":"https://api.github.com/users/jzajac2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-22T00:22:47Z","updated_at":"2018-04-24T21:51:49Z","closed_at":null,"author_association":"NONE","body":"Trying this:\r\n\r\n```\r\neditor.replace(\"Path=\\\"Source\\\\MySecretProject\\\\obj\\\\Debug\\\\MySecretProject.dll\", \"Path=\\\"Source\\\\%ProjectName%\\\\obj\\\\%Configuration%\\\\%TargetFileName%\")\r\neditor.replace(\"Path=\\\"Source\\\\MySecretProject\\\\bin\\\\Debug\\\\MySecretProject.dll\", \"Path=\\\"Source\\\\%ProjectName%\\\\bin\\\\%Configuration%\\\\%TargetFileName%\")\r\n```\r\n\r\nHowever result in the replacement when I run the macro ends up as:\r\n\r\n`Path=\"Source%ProjectName%obj%Configuration%%TargetFileName%\"`\r\n\r\nUnfortunately I'm limited to having to replace strings with backslashes in them as there are other strings with word 'Debug' which I DON'T want to replace (these ones are not part of msbuild I am using to replace with env vars). And I don't think editor.replace() comes with a way to replace 'whole word only'. Therefore, I am qualifying with a rather large string with backslashes. Hmm..Still thinking of a way.  \r\n\r\nMaybe a way out of this with a regex replace. Let me know if you can think of a good workaround, I'm new to python."},"comment":{"url":"https://api.github.com/repos/bruderstein/PythonScript/issues/comments/384091835","html_url":"https://github.com/bruderstein/PythonScript/issues/30#issuecomment-384091835","issue_url":"https://api.github.com/repos/bruderstein/PythonScript/issues/30","id":384091835,"user":{"login":"ClaudiaFrank","id":16170444,"avatar_url":"https://avatars2.githubusercontent.com/u/16170444?v=4","gravatar_id":"","url":"https://api.github.com/users/ClaudiaFrank","html_url":"https://github.com/ClaudiaFrank","followers_url":"https://api.github.com/users/ClaudiaFrank/followers","following_url":"https://api.github.com/users/ClaudiaFrank/following{/other_user}","gists_url":"https://api.github.com/users/ClaudiaFrank/gists{/gist_id}","starred_url":"https://api.github.com/users/ClaudiaFrank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClaudiaFrank/subscriptions","organizations_url":"https://api.github.com/users/ClaudiaFrank/orgs","repos_url":"https://api.github.com/users/ClaudiaFrank/repos","events_url":"https://api.github.com/users/ClaudiaFrank/events{/privacy}","received_events_url":"https://api.github.com/users/ClaudiaFrank/received_events","type":"User","site_admin":false},"created_at":"2018-04-24T21:51:49Z","updated_at":"2018-04-24T21:51:49Z","author_association":"CONTRIBUTOR","body":"In case someone stumbles across this, something like this would solve this issue\r\n`editor.replace(r'Path=\\\"Source\\MySecretProject\\obj\\Debug\\MySecretProject.dll\"', r'Path=\\\\\"Source\\\\%ProjectName%\\\\obj\\\\%Configuration%\\\\%TargetFileName%\"')`"}}
{"actor":{"display_login":"ClaudiaFrank"}}