Replace doesn't seem to like . :
It seems you're confused; \ is the string escape character. replace will never see the \ in the string ".", since it is equvivalent to the string ".".
string s = Pike v7.6 release 13 running Hilfe v3.5 (Incremental Pike Frontend)
string s = "foo.bar.com"; replace(s, ".", ".");
(1) Result: "foo.bar.com"
replace(s, "a", ".");
(2) Result: "foo.b.r.com"
replace(s, "a", "\b");
(3) Result: "foo.b\br.com"
In the last case you're actually specifying a valid -escape (BEL).
It does the same with 7.2, 7.4
As it should.
/ Henrik Grubbström (Lysator)
Previous text:
2004-09-09 14:43: Subject: Bug in replace
Hi,
Replace doesn't seem to like . :
string s = Pike v7.6 release 13 running Hilfe v3.5 (Incremental Pike Frontend)
string s = "foo.bar.com"; replace(s, ".", ".");
(1) Result: "foo.bar.com"
replace(s, "a", ".");
(2) Result: "foo.b.r.com"
replace(s, "a", "\b");
(3) Result: "foo.b\br.com"
It does the same with 7.2, 7.4
/ David
/ Brevbäraren