[erlang-questions] adding slashes for special chars

Andrey Shnayder camuig@REDACTED
Wed Jun 25 13:52:01 CEST 2008


Thank you, Hyrek! I understand it now!

2008/6/25, Hynek Vychodil <vychodil.hynek@REDACTED>:
>
> It is little bit difficult. In regexp you have to escape backslash and
> secondary must escape backslash for erlang parser but for substituting
> string you have to only escape for erlang parser. Weird, so ...
>
> 5> {ok, T, _} = regexp:gsub("qwert\\asdf", "\\\\", "\\\\").
> {ok,"qwert\\\\asdf",1}
> 6> io:format("~s~n", [T]).
> qwert\\asdf
> ok
>
> --
> --Hynek (Pichi) Vychodil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080625/efd6ea89/attachment.htm>


More information about the erlang-questions mailing list