title: Cleaning a text with Regular expression
body: <p>I am reading a text file and I want to find correct tokens of the text. But I have problem with dot at the end of the sentences.My code is the following code and query means input string:</p>
  
  <pre><code>    query = query.replaceAll("[^\\p{L}\\s0-9-_/.]", "");
      query = query.replaceAll("\t", " ");
      query = query.replaceAll("\r", " ");
      query = query.replaceAll("\n", " ");
      StringTokenizer words = new StringTokenizer(query, " ");    
      while(tokens.hasMoreTokens()){
              String str=tokens.nextToken();
              String regex = "\\d+.\\d+";
              if(!str.matches(regex)) *&lt;- second problem*
                 System.out.println(str);
  </code></pre>
  
  <p>For example; the Input text is the following line</p>
  
  <pre><code>THE WORLD OF UNIQUE VENDING CARTS. fy_lkaris@yahoo.com  www.ubc_lib?9867.come/homepage 876454 9890-9999-9099.
  </code></pre>
  
  <p>I want the following string as output</p>
  
  <pre><code>THE WORLD OF UNIQUE VENDING CARTS
  fy_lkaris@yahoo.com
  www.ubc_lib?9867.come/homepage
  9890-9999-9099
  </code></pre>
  
  <p>But my real out put has dot at the end of first and last line of output.
  I can not delete dot (.) since it delete from every place.</p>
  
  <pre><code>THE
  WORLD
  OF
  UNIQUE
  VENDING
  CARTS.ff_lashkariyahoo.com   *&lt;-problem*
  www.unb_lib9867.come/homepage
  9890-9999-9099.              *&lt;-problem*
  </code></pre>
  
  <p>Also I want to delete only numbers like 4,764,90.900 not 76-098-098 and I could not find any better than useing <strong>match</strong> function .Is there any way to solve this problem too.</p>
  
  <p>Could you please help me?</p>