Antwort: [Perl-unix-users] regex numerical matching w/comma seperated list support

2005-06-10 Thread Georg . Mavridis
        if ($value =~ /^[0-9]+(,[0-9]+)?$/) { HTH George BTW use \d instead of [0-9].___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Antwort: [Perl-unix-users] regex numerical matching w/comma seperated list support

2005-06-10 Thread Georg . Mavridis
Oops -- mistyped:         if ($value =~ /^[0-9]+(,[0-9]+)*$/) { should be correct i think. Sorry :( George___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

[Perl-unix-users] regex numerical matching w/comma seperated list support

2005-06-10 Thread listmail
#!/usr/bin/perl -w use strict; use warnings; my @values = ('1','12','123','1,2','12,34',',123','123,'); foreach my $value (@values) { # check that value is number and it can be comma seperated list of # numbers but doesn't have to be. the last two values in @values #