Re: regexp



On Jan 30, 6:30 am, avlee <x...@xxxxx> wrote:
How to cut all the characters from varibale except digits ?

$string =~ tr/0-9//cd;

or, using a regexp, as your subject line mentioned:

$string =~ s/\D+//g;

Please read:
perldoc perlop (search for "tr/")
perldoc perlretut
perldoc perlre

Paul Lalli

.



Relevant Pages