Browse Source

Regex updated with lookahead

feature-config-parsing2
MagicBot 4 months ago
parent
commit
cc6f5f5f25
  1. 6
      src/engine/ConfigParsing/EffectsParser.java

6
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 String EffectsPath = ConfigManager.DEFAULT_DATA_DIR + "wpak/Effects.cfg";
public static HashMap<String, EffectEntry> effect_data = new HashMap<>(); public static HashMap<String, EffectEntry> effect_data = new HashMap<>();
private static final Pattern EFFECT_REGEX = Pattern.compile("EFFECTBEGIN(.+?)EFFECTEND", 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 SOURCE_REGEX = Pattern.compile("(?<=SOURCEBEGIN)(.+?)(?=SOURCEEND)", Pattern.DOTALL);
private static final Pattern MODS_REGEX = Pattern.compile("MODSBEGIN(.+?)MODSEND", Pattern.DOTALL); private static final Pattern MODS_REGEX = Pattern.compile("(?<=MODSBEGIN)(.+?)(?=MODSEEND)", Pattern.DOTALL);
public static void init() throws IOException { public static void init() throws IOException {

Loading…
Cancel
Save