It's just not recognizing the beginning anchor (^).
Lua Code:
/script string.gsub("une rune de puissance", "^(%l+) ", function(str) d(str) end)
une
rune
de
As far as the number of matches, it's correct (without the beginning anchor). It matches 3 words with spaces after, even though it can only replace two.
I suppose as a hack way, you could use a function and only replace the first time it's called:
Lua Code:
function singleSub(str, match, lookup)
local inReplace = true
return str:gsub(match, function(str)
if not inReplace then
return str
end
inReplace = false
return lookup[str] or str
end)
end
The fix for ZOS would be to see why ^ is being ignored in patterns.