in reply to Validating Comma Delimited String

As Corion points out, you can't have a variable number of captures, but as you don't ask about/mention it explicitly, that probably isn't a problem ;-)

More of a problem, however, is your use of a range ([...]) c/w a block/capture ((...)). Try ...

perl -we '$string = qq/9500,9501,fred,,9999/; map { warn qq/Bad entry: + $_ in string $string/ } grep ! /^\d{4}$/, split /,/, $string;'
Gives
Bad entry: fred in string 9500,9501,fred,,9999 at -e line 1. Bad entry: in string 9500,9501,fred,,9999 at -e line 1.

A user level that continues to overstate my experience :-))