From 9ee2592ec7527cd148d140ece9780c5c47552781 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 19 Aug 2024 07:45:26 -0400 Subject: [PATCH] Regex update --- src/engine/wpak/EffectsParser.java | 2 +- src/engine/wpak/PowersParser.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/wpak/EffectsParser.java b/src/engine/wpak/EffectsParser.java index 295f1c21..19060087 100644 --- a/src/engine/wpak/EffectsParser.java +++ b/src/engine/wpak/EffectsParser.java @@ -55,7 +55,7 @@ public class EffectsParser { // Remove all lines that contain a # and leading/trailing blank lines - effectData = effectData.replaceAll("(?m)^[ \t]*\r?\n?", ""); + effectData = effectData.replaceAll("(?m)^(\\s*#.*|\\s*)\r?\n?", ""); effectData = effectData.trim(); // Parse effect entry header diff --git a/src/engine/wpak/PowersParser.java b/src/engine/wpak/PowersParser.java index 7de50682..0e8a342f 100644 --- a/src/engine/wpak/PowersParser.java +++ b/src/engine/wpak/PowersParser.java @@ -72,9 +72,9 @@ public class PowersParser { // Cleanup dangling tags and lines that contain a # and leading/trailing blank lines powerString = new StringBuilder(powerString.toString().replaceAll("CONDITIONBEGINCONDITIONEND", "")); - powerString = new StringBuilder(powerString.toString().replaceAll("(?m)^[ \t]*\r?\n?", "")); + powerString = new StringBuilder(powerString.toString().replaceAll("(?m)^(\\s*#.*|\\s*)\r?\n?", "")); - conditionString = new StringBuilder(conditionString.toString().replaceAll("(?m)^[ \t]*\r?\n?", "")); + conditionString = new StringBuilder(conditionString.toString().replaceAll("(?m)^(\\s*#.*|\\s*)\r?\n?", "")); // Parse header line in power data