How to replace backslash

gvanuxem
Wed, 11 Jun 2025 17:19:49 +0000
New to Julia

Hello,

For example, this one does not work:

julia> replace("foo  \spadbar{jjjd}","\\spad"=>"")
ERROR: ParseError:
# Error @ REPL[6]:1:21
ulia> replace("foo  \spadbar{jjjd}","\\spad"=>"")
#                   └┘ ── invalid escape sequence
Stacktrace:
 [1] top-level scope
   @ none:1

The first string is extracted from a database and contains some TeX like strings.

Regards,

Greg

3 posts - 2 participants