How can I build a regular expression that will match a string of any length containing any characters but which must contain 21 commas?
Exactly 21 commas:
^([^,]*,){21}[^,]$
At least 21 commas:
^([^,]?,){21}.*$