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" }
In reply to Re: what is the best way to seperate the digits and strings from variable ?
by sh1tn
in thread what is the best way to seperate the digits and strings from variable ?
by swaroop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |