$text =~ m{ ^ \s* ( ,\s* )? # allow stuff to precede first language (?: $re_langs (?: \s+ | \s* , \s* | \z ) )* \z }x;