He had spaces in his input string. I presume he wants you to allows spaces too. If you're going to take his question literally, then /^(?:[0-9,]*)$/ would suffice.
Considering the OP named it 'checked_ids' I was more or less interpreting that as meaning that that is where he will store the result of the check, not the actual data that needs to be tested. Dear OP, please enlighten us :-)