RCP has asked for the wisdom of the Perl Monks concerning the following question:

Trace 118.676 71.568 125.229 71.568 of size 0.254 on Net +5.0V overlaps

In the above line, I need to remove "of size 0.254 (this could be any numbers)" from the line. I tried:
s/of size [0-1000]//g;
But I suspect that since there is decimal point here, that the "0.254" is percieved as a string?
How do I get rid of the numbers even if they are 0.254 or 254? as well as the words "of size"?

Earlier Post Ref: EXTRACT & REWRITE

Replies are listed 'Best First'.
Re: removing two words and integer
by ikegami (Patriarch) on Sep 02, 2004 at 17:32 UTC
    s/of size [0-9.]+//g;

    [0-1000] means "any characters between '0' and '1', or a '0', or a '0', or a '0'".

Re: removing two words and integer
by si_lence (Deacon) on Sep 02, 2004 at 17:56 UTC
    use something like

    s/size of [\d\.]+//;


    and I may suggest that you read a bit about regualr expressions (perldoc perlretut for example)

    si_lence
      There's no need to escape the . with \ inside of [].
        You are -of course - right.
        My bad.
        Not my day today..

        si_lence (embarrassed of giving advise while making mistakes)