From a4a002f9b8d4267980c4f9b3f3852266f095fd16 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 6 May 2024 16:44:32 +0200 Subject: added regex tests --- .../skyhanni/features/misc/compacttablist/TabListReader.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt index 68b65fcc0..1e1f2fd76 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt @@ -24,14 +24,23 @@ object TabListReader { "username", "^\\[(?\\d+)] (?:\\[\\w+] )?(?\\w+)" ) + /** + * REGEX-TEST: §r§r§7You have a §r§cGod Potion §r§7active! §r§d12 Hours§r + */ private val godPotPattern by patternGroup.pattern( "effects.godpot", - "You have a God Potion active! (?[\\w ]+)" + "§r§r§7You have a §r§cGod Potion §r§7active! §r§d(?[\\w ]+)§r" ) + /** + * REGEX-TEST: §r§r§a§lActive Effects§r + */ private val activeEffectPattern by patternGroup.pattern( "effects.active", "Active Effects(?:§.)*(?:\\n(?:§.)*§7.+)*" ) + /** + * REGEX-TEST: §r§r§7§r§7You have §r§e1 §r§7active effect. Use "§r§6/effects§r§7" to see it!§r + */ private val effectCountPattern by patternGroup.pattern( "effects.count", "You have (?:§.)*(?[0-9]+) (?:§.)*active effect" -- cgit