public class TelNumber {
public static void main(String[] args) {
String[] telNumber = {"16210626656","18601066888","13912387666","13156166693","15115888028"};
String pattern = "1[358]\\d{6}(000|111|222|333|444|555|666|777|888|999)";
for (int i = 0; i < telNumber.length; i++) {
if(telNumber[i].matches(pattern)){
System.out.println(telNumber[i]);
}
}
}
} |
|