From bbe125beee7b3f2fd3b2d08cb641b8e1528ee089 Mon Sep 17 00:00:00 2001 From: ebbit1q Date: Sun, 25 Aug 2024 02:31:01 +0200 Subject: [PATCH] replace cipt check with regex (#5094) --- oracle/src/oracleimporter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oracle/src/oracleimporter.cpp b/oracle/src/oracleimporter.cpp index 565bf908b..d48824cc0 100644 --- a/oracle/src/oracleimporter.cpp +++ b/oracle/src/oracleimporter.cpp @@ -141,9 +141,9 @@ CardInfoPtr OracleImporter::addCard(QString name, // DETECT CARD POSITIONING INFO // cards that enter the field tapped - bool cipt = text.contains(" it enters the battlefield tapped") || - (text.contains(name + " enters the battlefield tapped") && - !text.contains(name + " enters the battlefield tapped unless")); + QRegularExpression ciptRegex("( it|" + QRegularExpression::escape(name) + + ") enters( the battlefield)? tapped(?! unless)"); + bool cipt = ciptRegex.match(text).hasMatch(); // table row int tableRow = 1;