Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.regex.*;
- import java.util.regex.*;
- public class Demo2
- {
- public static void main(String [] args)
- {
- String rcvd = args[0];
- String pattern = "^(\\d){1,3}.(\\d){1,3}.(\\d){1,3}.(\\d){1,3}$";
- // Pattern r = Pattern.compile(pattern);
- // Matcher m = r.matcher(rcvdString);
- // if (m.find( ))
- // {
- //
- //
- // }
- // else
- // {
- // System.out.println("Not a Valid IP");
- // }
- do
- {
- int ind = rcvd.indexOf(".");
- //System.out.println(ind);
- //System.out.println(rcvd);
- rcvd = rcvd.substring(ind+1 , rcvd.length());
- System.out.println(rcvd);
- }
- while(rcvd.indexOf(".") != -1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement