TIMTOWTDI; personally I'd write:
die "invalid format: $string"
Update: Note your specification is a bit unclear, you say "each one of the substrings can contain whatever symbol there is" but then later on say that the strings can't* contain commas. What about, for example, "1,2,3, ,5,6" (which the above regex will call valid)? See also Re: How to ask better questions using Test::More and sample data.
* Update 2: Sorry, I misunderstood your post, you're saying the strings can contain commas. See my reply below.