in reply to what is the best way to seperate the digits and strings from variable ?

my $var = '12345text6789'; my $digits = ''; $digits .= $1 while $var =~ /([0-9]+)/g; if( $digits ){ print "digits are $digits\n" }else{ print "no digits detected\n" }


  • Comment on Re: what is the best way to seperate the digits and strings from variable ?
  • Download Code