I have the following code:
private static final String ET_AL = "(\p{Punct}|\b|^|\s)et\.? al\.?(\b|$|\s)";
private static final Pattern ET_AL_PATTERN = Pattern.compile(ET_AL, Pattern.CASE_INSENSITIVE);
...
Matcher m = ET_AL_PATTERN.matcher("Doe, J.; Brown, C.; et al");
while(m.find()) {
System.out.println(m.group());
}
m.reset();
System.out.println(m.matches());
The loop prints "et al" but the call to m.matches() returns false. Also m.groupCount() returns 2. Any help about what is going on?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…