fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.util.regex.*;
  4.  
  5. class Main
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. String number = "89371477777";
  10. Pattern p = Pattern.compile("(\\d)\\1{3}");
  11. Matcher m = p.matcher(number);
  12. if (m.find()) {
  13. System.out.println("Найдено");
  14. }
  15. }
  16. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
Найдено