如何打印不匹配正则表达式模式的列号和行号。
我当前的代码:
reader = new BufferedReader(new FileReader(credentialPath));
Pattern pattern = Pattern
.compile(ApplicationLiterals.CREDENTIALS_URL_REG_EX);
String line;
while ((line = reader.readLine()) != null) {
Matcher matcher = pattern.matcher(line.trim());
if (matcher.find()) {
// System.out.println(matcher.group());
// System.out.println("**" + matcher.start());
// System.out.println("***" + matcher.end());
result = true;
count1++;
} else {
// count1++;
result = false;
// System.out.println(matcher.group());
// System.out.println(matcher.start());
System.out.println("****problem at line number" + count1);
break;
}
}