Advertisement
Guest User

dotv2

a guest
Feb 19th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.regex.Pattern;
  2. import java.util.regex.Matcher;
  3.  
  4. class Ideone
  5. {
  6.     public static void main (String[] args) throws java.lang.Exception
  7.     {
  8.         Pattern pattern = Pattern.compile("\\b(\\d+)((?:\\d{3})+)\\b");
  9.         Matcher matcher = pattern.matcher("sanyi1234 12345678910 másiksanyi12 142857142");
  10.         System.out.println( matcher.replaceAll("$1.$2") );
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement