$text =~ m{ ^ (?: $re_langs \b | \s | , (?! \s*, ) # comma not followed by another comma # (not even with intervening whitespace) )* \z }x;