diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index d2603651..716c62c1 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -2073,7 +2073,7 @@ public class NEUEventListener { Pattern pattern; try { pattern = Pattern.compile("(\\u00A79|\\u00A79\\u00A7d\\u00A7l)("+enchantName+") " + - "([0-9]+|(I|II|III|IV|V|VI|VII|VIII|IX|X|XI|XII|XIII|XIV|XV|XVI|XVII|XVIII|XIX|XX))(,|$)"); + "(?<level>[0-9]+|(I|II|III|IV|V|VI|VII|VIII|IX|X|XI|XII|XIII|XIV|XV|XVI|XVII|XVIII|XIX|XX))((\\u00A79)?,|( \\u00A78(?:,?[0-9]+)*)?$)"); } catch(Exception e) {continue;} //malformed regex Matcher matcher = pattern.matcher(line); int matchCount = 0; @@ -2082,7 +2082,7 @@ public class NEUEventListener { matchCount++; int level = -1; - String levelStr = matcher.group(matcher.groupCount()-2); + String levelStr = matcher.group("level"); if(levelStr == null) continue; try { level = Integer.parseInt(levelStr); |