in reply to Re: Strip non-numeric
in thread Strip non-numeric

Basically, in any given string, I want only numeric and decimal values retained. So, basically:

1a => 1
1a.2b => 1.2
1a.2b.3c => 1.2.3

^^ Just as those show, no matter how many decimals or numeric values, those are the only characters I want retained. Hope this clears it up just a bit.

Replies are listed 'Best First'.
Re: Strip non-numeric
by Abigail-II (Bishop) on Jan 14, 2003 at 21:44 UTC
    So, you want to delete anything that isn't a number or a dot? Just do:
    s/[^\d.]+//g;
    or
    tr/0-9.//cd;

    Abigail