back in legion, this is how I got the numbers, and only the numbers, out of the artifact power item tooltips without seperators. You can modify this to do what you want (I would guess).
Code:
appower = string.match(_G[self:GetName().."TextLeft"..i]:GetText(), "%d+%,?%.?%s?%d*");
appower = string.gsub(string.gsub(appower, "%,", ""), "%.", "");