1

perl regular expression not inbetween issue

view story
linux-howto

http://www.unix.com – Dear All, Code: perl -e 'if($ARGV[0] =~ /\A^[0-9]{10}\z/){print "Valid string\n"}else{print "Invalid string\n"}' '1234567899' Valid string perl -e 'if($ARGV[0] =~ /\A^[0-9]{8}\z/){print "Valid string\n"}else{print "Invalid string\n"}' '12345678' Valid string individually both works, anyway to combine both together? the outcome should be "Valid string" when the length eq 8 or 10, but not 9, so i cannot use {8,10} as it includes 9. Thanks (HowTos)