[^,]
means "one character, any character except a ,
".
So your regex was checking that there was at least one non-comma character.
You can use this instead to ensure only non-comma characters are in your string:
^[^,]+$
^$
are anchors matching the beginning and end of the string respectively.