#! perl use strict; use warnings; my $regex = qr/ \A [^,]+ \Z /x; my $var = "abc,d"; my $flag = 1 if $var =~ /\G ($regex) /gcx; print $flag ? '' : 'not ', "matches\n"; #### 16:38 >perl 827_SoPW.pl not matches 16:42 >