[erlang-questions] Stripping slashes from a string

Martin Dimitrov mrtndimitrov@REDACTED
Fri Apr 27 09:28:17 CEST 2012


Hi,

What I am trying to achieve is not to convert "\\\\n" to "\\n" but "\\n"
to [10].

Martin

On 4/27/2012 10:24 AM, Sergei Golovan wrote:
> On Fri, Apr 27, 2012 at 11:19 AM, Martin Dimitrov
> <mrtndimitrov@REDACTED> wrote:
>> With 6 it produces double backslashes making the result equivalent to
>> the initial text:
> True, I oversaw that the replacing regexp was incorrect too (also, the
> string itself).
>
> 1> re:replace("\\\\r \\\\n text", "\\\\\\\\(r|n)", "\\\\\\1",
> [{return,list}, global, unicode]).
> "\\r \\n text"
> 2>
>
> works fine.
>
> Cheers!




More information about the erlang-questions mailing list