Lua does not use regex. It has a similar but limited engine:
https://wow.gamepedia.com/Pattern_matching
In this case, since I assume you want to keep the comma in the center, you need %d with parenthesis and then %# in the replacement argument
Lua Code:
local text = "The number 45,678 is big, but 1,234 is small."
text = string.gsub(text, "(%d),(%d)", "%1%2")
print(text)
-- should be: "The number 45678 is big, but 1234 is small."
The %d,%d captures any comma surrounded by numbers, the parenthesis "saves" the two numbers, and %1%2 outputs those two numbers in place without the comma.