正規表現のパターンが一致していない列番号と行番号を印刷するにはどうすればよいですか。
私の現在のコード:
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;
}
}