[erlang-questions] Stripping slashes from a string

Martin Dimitrov <>
Fri Apr 27 09:38:43 CEST 2012

Sorry Sergei. My bet.

In the original message I describe that my current solution is exactly
what you are suggesting but I wondered if it is possible to replace both
in one run.

Best regards,


On 4/27/2012 10:36 AM, Sergei Golovan wrote:
> 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!

More information about the erlang-questions mailing list