String sCurrentLine;
br = new BufferedReader(new FileReader(path));
while ((sCurrentLine = br.readLine()) != null) {
Pattern pattern = Pattern.compile(".*?unregistKey\\(tvKey\\.(.*?)\\);");
Matcher m= pattern.matcher(sCurrentLine);
if(m.matches()) {
String abc = m.group(1) ;
System.out.println ("aaaaaaaaaaaaaa" + abc.toString());
}
}
为什么此代码循环超过 1 次。我检查了对这段代码的调用,但它只出现了 1 次。
o/p 是这样的 N 次:
aaaaaaaaaaaaaaKEY_1
aaaaaaaaaaaaaaKEY_2
aaaaaaaaaaaaaaKEY_3
aaaaaaaaaaaaaaKEY_CH_UP
aaaaaaaaaaaaaaKEY_PANEL_CH_UP
aaaaaaaaaaaaaaKEY_CH_DOWN
aaaaaaaaaaaaaaKEY_1
aaaaaaaaaaaaaaKEY_2
aaaaaaaaaaaaaaKEY_3
aaaaaaaaaaaaaaKEY_CH_UP
aaaaaaaaaaaaaaKEY_PANEL_CH_UP
aaaaaaaaaaaaaaKEY_CH_DOWN