[erlang-questions] question about regexp:gsub \&

Per Melin list.nabble@REDACTED
Sun Jul 15 00:43:03 CEST 2007



yin sun wrote:
> 
> 35> regexp:gsub("<>",">","\&").
> {ok,"<>",1}
> 

The first backslash is eaten by Erlang.

1> "\&".
"&"
2> length("\&").
1

So you need to use "\\&" instead.

-- 
View this message in context: http://www.nabble.com/question-about-regexp%3Agsub-%5C--tf4080421.html#a11597974
Sent from the Erlang Questions mailing list archive at Nabble.com.




More information about the erlang-questions mailing list