public static void main(String[] args) throws Exception {
String [] str ={"16210626656","18601066888","13912387666","13156166693","15115888028"};
String regex ="[1][358][0-9]{6}(\\d){3}";
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(str);
boolean b = m.matches();
while(m.find()){System.out.println(m.group());}
}
-----------------------------------------------------------------------
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method matcher(CharSequence) in the type Pattern is not applicable for the arguments (String[])
at day14_try.Num2.main
---------------------------------------------------------------------我都无语了,怎么回事呢
|
|