# Invalid escape sequence

**URL:** <https://discourse.julialang.org/t/invalid-escape-sequence/12154>\
**Category:** General Usage\
**Tags:** question\
**Created:** [July 4, 2018, 10:33am UTC](https://discourse.julialang.org/t/invalid-escape-sequence/12154 "2018-07-04T10:33:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Post date:** [July 4, 2018, 10:33am UTC](https://discourse.julialang.org/t/invalid-escape-sequence/12154/1 "2018-07-04T10:33:48Z")

</div>

In Windows, the autocomplete (i.e. tab) will add a backslash before any whitespaces.  
e.g. If I want to include a file which is in a folder with whitespaces, I get the error below (second line)  
Is this expected?  
I am not even sure if the tab autocomplete is a Windows or Julia feature (and why the backslash appears).

Notably, the command works just fine if I ‘write’ the folder name by hand without '\ ’ (see last line).

```julia
julia> isfile("c:\\temp\\some folder with whitespace\\x.jl")
true

julia> include("C:\\temp\\some\ folder\ with\ whitespace\\x.jl")
ERROR: syntax: invalid escape sequence

julia> include("c:\\temp\\some folder with whitespace\\x.jl")

julia> versioninfo()
Julia Version 0.7.0-beta.0
Commit f41b1ecaec (2018-06-24 01:32 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
Environment:
  JULIA_BINDIR = C:\Julia-0.7.X\bin\
  JULIA_EDITOR = "C:\Program Files (x86)\Notepad++\notepad++.exe"
  JULIA_HOME = C:\Julia-0.6.X\bin\

julia>

```

---

<div class="post-metadata">

**Author:** ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Post date:** [July 4, 2018, 4:29pm UTC](https://discourse.julialang.org/t/invalid-escape-sequence/12154/2 "2018-07-04T16:29:53Z")

</div>

I confirm the same in Linux. I pretty sure the completion is done by Julia. So it looks like a bug.

```julia
shell> touch "a b"

julia> include("a\ b")

```

In this case I have to type `a\ [TAB]`

Backslash-space is an invalid escape sequence.

```julia
julia> "a\ b"
ERROR: syntax: invalid escape sequence

```

EDIT: It’s easier to find what’s wrong if you provide something close to a MWE. For instance, I used a short file name with one space. And the file has length zero. I neglected to include this:

```julia
julia> include("a b")

```

---

<div class="post-metadata">

**Author:** ![jandehaan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jandehaan/32/6805_2.png) [@jandehaan](https://discourse.julialang.org/u/jandehaan)\
**Post date:** [July 4, 2018, 4:51pm UTC](https://discourse.julialang.org/t/invalid-escape-sequence/12154/3 "2018-07-04T16:51:57Z")

</div>

Escape sequences have been changed in v0.7.0.  
For the motivation see [string literals: disallow backslash before non-escapes](https://github.com/JuliaLang/julia/issues/21284)

Personally this change has been bugging me too (pun intended).  
An easy solution is to use `raw` strings

```julia
julia> raw"C:\temp\some\ folder\ with\ whitespace\x.jl"
"C:\\temp\\some\\ folder\\ with\\ whitespace\\x.jl"

```
