[erlang-questions] regexp behaviour

shehan shehan@REDACTED
Sat Mar 15 05:40:46 CET 2008

Hi all,


Is the some way to stop the following behaviour of the "sub" function in the
"regexp" module


Str1 = "String with & character"

Str2 = "Replace the following tag <replace> with str1"


regexp:sub(Str2, "<replace>", Str1).



{ok, NewStr, Count} = regexp:gsub(Str1, ["<ad2>"], Ad2). 


"Replace the following tag String with <replace> character with str1"


The <replace> is replaced by the content of Str1, but the & character in
Str1 has been replaced by the 

replaced character set <replace>. is there some way to stop this from




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080315/05cac1e8/attachment.htm>

More information about the erlang-questions mailing list