note
jeroenes
<div class="pmsig"><div class="pmsig-41288">
Hi [heezey],
<p>
Why not try without regex?
<code>
print "yes" if not tr/a-zA-Z,//c and not ( str( $_, ',', 0) or str $_, ',' ,-1);
</code>
Did not check it but should work.
<p>
Cheers,<p>Jeroen
<i>"We are not alone"(FZ)</i>
</div></div>
<p>
After some self-flaggalation:
<code>
for (qw/ ,asd asd:asd asd, asd,asd asd,,asd/){
my $test = $_;
print "$test: ";
print "yes" unless $test=~tr/a-zA-Z,//c or index( $test, ',') == 0 or index( $test, ',') == -1 + length( $test) or index( $test, ',,') > 0;
print "\n";
}
</code>
<p>
My perl clearly is rusty, and I even don't know anymore in which language str is valid ;). <p>
However, still possible without regexes {grin}.
298670
298670