comma in regex in String.replaceAll() method?
<p>My code tries to replace "," with "/" in a string. Should I escape "," in the regex string? Both of the two code snippets generated the same results, so I am confused.</p>

<p>Code snippet 1:</p>

<pre><code>    String test = "a,bc,def";

    System.out.println(test.replaceAll("\\,", "/"));
</code></pre>

<p>Code snippet 2:</p>

<pre><code>    String test = "a,bc,def";

    System.out.println(test.replaceAll(",", "/"));
</code></pre>

<p>Should I use "," or "\,"? Which is safer?</p>

<p>Thanks.</p>
