From dd656ba1bd8c2d9ddb4d286d1d833b0bdfcbcb21 Mon Sep 17 00:00:00 2001 From: coppro Date: Sun, 30 Sep 2007 14:37:18 +0000 Subject: [PATCH] Fixed "regex escape" function, and updated a script that needed it. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@762 0fc631ac-6414-0410-93d0-97cfa31319b6 --- data/magic.mse-game/game | 4 ++-- src/script/functions/basic.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/magic.mse-game/game b/data/magic.mse-game/game index c7b89a6e..3fa6ac69 100644 --- a/data/magic.mse-game/game +++ b/data/magic.mse-game/game @@ -1,4 +1,4 @@ -mse version: 0.3.5 +mse version: 0.3.5 short name: Magic full name: Magic the Gathering icon: card-back.png @@ -112,7 +112,7 @@ init script: text_to_color := { # Note: running filter_text is quite slow, do a quick 'contains' check first if contains(match: card_name) then ( - text := filter_text(match: card_name+"()? is (colorless|all colors|((blue|white|green|red|black)((,|,? and) (blue|white|green|red|black))*))\\.") + text := filter_text(match: regex_escape(card_name)+"()? is (colorless|all colors|((blue|white|green|red|black)((,|,? and) (blue|white|green|red|black))*))\\.") if text != "" then ( if contains(text, match: "all colors") then ( colors := "WUBRG" diff --git a/src/script/functions/basic.cpp b/src/script/functions/basic.cpp index 9807c39b..f0387bf9 100644 --- a/src/script/functions/basic.cpp +++ b/src/script/functions/basic.cpp @@ -610,7 +610,7 @@ void init_script_basic_functions(Context& ctx) { ctx.setVariable(_("format"), script_format); ctx.setVariable(_("format rule"), script_format_rule); ctx.setVariable(_("curly quotes"), script_curly_quotes); - ctx.setVariable(_("regex_escape"), script_regex_escape); + ctx.setVariable(_("regex escape"), script_regex_escape); // tagged string ctx.setVariable(_("tag contents"), script_tag_contents); ctx.setVariable(_("remove tag"), script_tag_remove);