$pattern = '/^,+$/';
var_dump( preg_match($pattern, $txt) );
$commas = ',,,,';
$commasWithDigit = ',,,3,';
$commasWithCyrillicLetter = 'б,,,,';
$commasWithLatinLetter = ',,b,,';
$pattern = '/\w/u';
var_dump(preg_match($pattern, $commas)); // false
var_dump(preg_match($pattern, $commasWithDigit)); // true
var_dump(preg_match($pattern, $commasWithCyrillicLetter)); // true
var_dump(preg_match($pattern, $commasWithLatinLetter)); // true