Hi,
I’m currently trying to create a custom JSON encoder. (The one roblox provides doesn’t work for my needs.)
I’m trying to make a string pattern that can easily match, for example,
10,49,[2,7],2
into
10
, 49
, [2,7]
and 2
However, the extra comma is throwing me off— simply using string.split won’t work.
I managed to solve this by iterating through each character, but it‘s less clean and less efficient than using string.gmatch.
Thanks.