Skip to content

Commit 2137509

Browse files
authored
Claude regex fix (#2141)
1 parent 950b7fa commit 2137509

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/Classes/Item.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,9 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
902902
-- Replace non-number ranges as unsupported
903903
line = line:gsub("(%a+)%([%a%s]+%-[%a%s]+%)", "%1")
904904

905+
-- Strip single values like 25(50) -> 25
906+
line = line:gsub("(%d+)%((%d+)%)", "%1")
907+
905908
for value, range in line:gmatch("(%-?%d+%.?%d*)%((%-?%d+%.?%d*%-%-?%d+%.?%d*)%)") do
906909
local min, max = range:match("(%-?%d+%.?%d*)%-(%-?%d+%.?%d*)")
907910
local delta = tonumber(max) - min

0 commit comments

Comments
 (0)