pattern.matcher("021-123456").matches(); // true
此处的注释应该是//false,因为第二个分组(\\d{7,8})表示的是7或8个数字,而例子中的123456只有6个数字,因此是false
Sign in to make a reply
梨花开sh
pattern.matcher("021-123456").matches(); // true
此处的注释应该是//false,因为第二个分组(\\d{7,8})表示的是7或8个数字,而例子中的123456只有6个数字,因此是false