[erlang-questions] Stripping slashes from a string

Sergei Golovan <>
Fri Apr 27 09:36:14 CEST 2012


Hi!

On Fri, Apr 27, 2012 at 11:28 AM, Martin Dimitrov
<> wrote:
>
> What I am trying to achieve is not to convert "\\\\n" to "\\n" but "\\n"
> to [10].

You didn't tell that. In this case I'd use two calls to re:replace/4
A = re:replace("\\\\r \\\\n text", "\\\\\\\\n", [10], [{return,list},
global, unicode]),
re:replace(A, "\\\\\\\\r", [13], [{return,list}, global, unicode]).

Cheers!
-- 
Sergei Golovan



More information about the erlang-questions mailing list