Advertisement
charleston10

Expressao regular class ip

Nov 9th, 2012
573
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.29 KB | None | 0 0
  1. ///expressão regular para controlar o IP valido
  2. String _255 = "(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";
  3. Pattern p = Pattern.compile("^(?:" + _255 + "\\.){3}" + _255 + "$");
  4. RegexFormatter ipFormatter = new RegexFormatter(p);
  5. txtip.setFormatterFactory(new DefaultFormatterFactory(ipFormatter));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement