Advertisement
Guest User

dotv1

a guest
Feb 19th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.util.regex.Pattern;
  7. import java.util.regex.Matcher;
  8.  
  9.  
  10. /* Name of the class has to be "Main" only if the class is public. */
  11. class Ideone
  12. {
  13.     public static void main (String[] args) throws java.lang.Exception
  14.     {
  15.         Pattern pattern = Pattern.compile("(\\d)(\\d{3})");
  16.         Matcher matcher = pattern.matcher("sanyi1234 12345678910 másiksanyi12 142857142");
  17.         System.out.println( matcher.replaceAll("$1.$2") );
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement