title: How to remove all special character in a string except dot and comma
body: <p>I have a sentence with many special characters and text in it, I want remove all the special characters except dot and comma.</p>
  
  <p>For example, this is what have:  </p>
  
  <pre><code>[u' %$HI# Jhon, $how$ are *&amp;$%you.%$
  </code></pre>
  
  <p>I'm trying to produce the following string:</p>
  
  <pre><code>HI Jhon, how are you.
  </code></pre>
  
  <p>I tried this </p>
  
  <pre><code>("[u' %$HI# Jhon, $how$ are *&amp;$%you.%$").replaceAll("[^a-zA-Z]+","");
  </code></pre>
  
  <p>But it removes commas and dots also. I want commas and dots to be there.</p>
  
  <p>Finally i found solution:</p>
  
  <p>Python:</p>
  
  <pre><code>import re
  
  my_str = "[u' %$HI# Jhon, $how$ are *&amp;$%you.%$"
  my_new_string = re.sub('[^.,a-zA-Z0-9 \n\.]', '', my_str)
  print (my_new_string)
  </code></pre>
  
  <p>Java:</p>
  
  <pre><code>("[u' %$HI# Jhon, $how$ are *&amp;$%you.%$").replaceAll("[^ .,a-zA-Z0-9]");
  </code></pre>
  
  <p>Thanks all. I Don't know whats wrong with my question, Don't have freedom to ask. :-(</p>