是否有一个正则表达式搜索可以像这样匹配我需要的?
Is there a regex search that'll match like this for as I need it done?
这是我的 Minecraft mod包。
我在 Visual Studio 代码中这样做。
我正在尝试编写一个正则表达式,可用于搜索和转换原版工艺 table 上的食谱并将其转换为 Artisan 作品table mod的等效。
我已经尽可能地缩小了正则表达式的范围。
我把它归结为使用单独的正则表达式搜索有形和无形食谱。
我想知道是否存在适用于这两种情况的单一正则表达式搜索模式。
所有内容的替换字段是
RecipeBuilder.get("basic")
.set()
.setFluid(<liquid:water> * 250)
.addTool(<artisanworktables:artisans_cutters_wood>, 1)
.addOutput()
.create();
示例形状的食谱
recipes.addShaped("minecraft:golden_rail", <minecraft:golden_rail> * 6, [[<ore:ingotGold>, null, <ore:ingotGold>], [<ore:ingotGold>, <ore:stickWood>, <ore:ingotGold>], [<ore:ingotGold>, <ore:dustRedstone>, <ore:ingotGold>]]);
形状的食谱正则表达式搜索
recipes.add(Shaped)\("(.+)", (.+), (\[\[(.+)\]\]\));
示例转换形状的配方
RecipeBuilder.get("basic")
.setShaped([[<ore:ingotGold>, null, <ore:ingotGold>], [<ore:ingotGold>, <ore:stickWood>, <ore:ingotGold>], [<ore:ingotGold>, <ore:dustRedstone>, <ore:ingotGold>]]))
.setFluid(<liquid:water> * 250)
.addTool(<artisanworktables:artisans_cutters_wood>, 1)
.addOutput(<minecraft:golden_rail> * 6)
.create();
无形食谱示例
recipes.addShapeless("minecraft:yellow_dye_from_dandelion", <minecraft:dye:11>, [<minecraft:yellow_flower>]);
无形配方正则表达式搜索
recipes.add(Shapeless)\("(.+)", (.+), (\[(.+)\]\));
转换后的无形配方示例
RecipeBuilder.get("basic")
.setShapeless([<minecraft:yellow_flower>]))
.setFluid(<liquid:water> * 250)
.addTool(<artisanworktables:artisans_cutters_wood>, 1)
.addOutput(<minecraft:dye:11>)
.create();
你可以试试这个
recipes.add(Shaped|Shapeless)\("(.+)", (.+), (\[{1,2}(.+)\]{1,2}\));
这是我的 Minecraft mod包。
我在 Visual Studio 代码中这样做。
我正在尝试编写一个正则表达式,可用于搜索和转换原版工艺 table 上的食谱并将其转换为 Artisan 作品table mod的等效。
我已经尽可能地缩小了正则表达式的范围。
我把它归结为使用单独的正则表达式搜索有形和无形食谱。
我想知道是否存在适用于这两种情况的单一正则表达式搜索模式。
所有内容的替换字段是
RecipeBuilder.get("basic")
.set()
.setFluid(<liquid:water> * 250)
.addTool(<artisanworktables:artisans_cutters_wood>, 1)
.addOutput()
.create();
示例形状的食谱
recipes.addShaped("minecraft:golden_rail", <minecraft:golden_rail> * 6, [[<ore:ingotGold>, null, <ore:ingotGold>], [<ore:ingotGold>, <ore:stickWood>, <ore:ingotGold>], [<ore:ingotGold>, <ore:dustRedstone>, <ore:ingotGold>]]);
形状的食谱正则表达式搜索
recipes.add(Shaped)\("(.+)", (.+), (\[\[(.+)\]\]\));
示例转换形状的配方
RecipeBuilder.get("basic")
.setShaped([[<ore:ingotGold>, null, <ore:ingotGold>], [<ore:ingotGold>, <ore:stickWood>, <ore:ingotGold>], [<ore:ingotGold>, <ore:dustRedstone>, <ore:ingotGold>]]))
.setFluid(<liquid:water> * 250)
.addTool(<artisanworktables:artisans_cutters_wood>, 1)
.addOutput(<minecraft:golden_rail> * 6)
.create();
无形食谱示例
recipes.addShapeless("minecraft:yellow_dye_from_dandelion", <minecraft:dye:11>, [<minecraft:yellow_flower>]);
无形配方正则表达式搜索
recipes.add(Shapeless)\("(.+)", (.+), (\[(.+)\]\));
转换后的无形配方示例
RecipeBuilder.get("basic")
.setShapeless([<minecraft:yellow_flower>]))
.setFluid(<liquid:water> * 250)
.addTool(<artisanworktables:artisans_cutters_wood>, 1)
.addOutput(<minecraft:dye:11>)
.create();
你可以试试这个
recipes.add(Shaped|Shapeless)\("(.+)", (.+), (\[{1,2}(.+)\]{1,2}\));