Re: String replaceAll doesn't like commas



Stefan Ram wrote:
"O.B." <funkjunk@xxxxxxxxxxxxx> did not write:

Why doesn't the following turn "Alpha, Inc." into "Alpha\, Inc."?
String test = "Alpha, Inc.";
test = test.replaceAll(",", "\\,");


  Why not just read about it in the documentation?

http://download.java.net/jdk6/docs/api/java/lang/String.html#replaceAll(java.lang.String,%20java.lang.String)

What's wrong with my regular expression? .