> HI all. Howdy > > I am trying to verify that a field has only numbers > > 12345 > 13456 > 34x34 The regex to check for that would be: m/^\d+$/ says match beginning with a digit, contain one or more digits, ending with a digit
for(@nums) { s/\D/0/; } id substitutiing any non digits with 0 Try this to see it in action: perl -e '@d = qw(12345 09876 12d4r a4*h5);for(@d) { print "-$_-";s/\D/0/g;print "-$_-\n"; }' HTH DMuey > > if it has non numbers I want to delete the non number with a zero? > > Snip > > $mil =~ s/[0-9]/$_/; > > this returns zero. > > Any help? > > > Ned Cunningham > POS Systems Developer > Monro Muffler Brake & Service > 200 Holleder Parkway > Rochester, New York 14615 > (585) 647-6400 ext 310 > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]