From cc6f5f5f2593a4a09d77a70d972c59ad5f4cb7d2 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 8 Aug 2024 11:56:31 -0400 Subject: [PATCH] Regex updated with lookahead --- src/engine/ConfigParsing/EffectsParser.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/ConfigParsing/EffectsParser.java b/src/engine/ConfigParsing/EffectsParser.java index 131a6d62..c8f48ffb 100644 --- a/src/engine/ConfigParsing/EffectsParser.java +++ b/src/engine/ConfigParsing/EffectsParser.java @@ -22,9 +22,9 @@ public class EffectsParser { public static String EffectsPath = ConfigManager.DEFAULT_DATA_DIR + "wpak/Effects.cfg"; public static HashMap effect_data = new HashMap<>(); - private static final Pattern EFFECT_REGEX = Pattern.compile("EFFECTBEGIN(.+?)EFFECTEND", Pattern.DOTALL); - private static final Pattern SOURCE_REGEX = Pattern.compile("SOURCEBEGIN(.+?)SOURCEEND", Pattern.DOTALL); - private static final Pattern MODS_REGEX = Pattern.compile("MODSBEGIN(.+?)MODSEND", Pattern.DOTALL); + private static final Pattern EFFECT_REGEX = Pattern.compile("(?<=EFFECTBEGIN)(.+?)(?=EFFECTEND)", Pattern.DOTALL); + private static final Pattern SOURCE_REGEX = Pattern.compile("(?<=SOURCEBEGIN)(.+?)(?=SOURCEEND)", Pattern.DOTALL); + private static final Pattern MODS_REGEX = Pattern.compile("(?<=MODSBEGIN)(.+?)(?=MODSEEND)", Pattern.DOTALL); public static void init() throws IOException {