Nope I wish.

3 fields. 1 is a part number, 2 is cost, 3 is list.
I am removing the '$' for 2 and 3. where as I am removing white space
from 1,2,&3.
I was just trying to do it all in one statement.

Frank Wiles solution worked perfectly.
s/(?:^\s+|\$+|\s+$)//g

Paul
-----Original Message-----
From: Rob Dixon [mailto:[EMAIL PROTECTED]] 
Sent: Monday, February 03, 2003 10:54 AM
To: [EMAIL PROTECTED]
Subject: Re: Search Replace



"Paul Kraus" <[EMAIL PROTECTED]> wrote in message
005b01c2cb99$02315ee0$8afea8c0@pkraus">news:005b01c2cb99$02315ee0$8afea8c0@pkraus...
> I have an array that I want to remove every instance of '$' and all 
> leading and trailing white space. My code only seems to remove '$'. I 
> know I can split this into
separate
> commands but is there a way to do this all at once?
>
> $_=~s/($\s+)||(\s+^)||(\$)//g foreach (@fields);
> I have also tried
> $_=~s/[($\s+)(\s+^)(\$)]//g foreach (@fields);

Hi Paul.

I assume you mean whitespace preceding and following the dollar?

    s/\s*\$\s*//g foreach @fields;

I'm sure you knew the answer really!

Cheers,

Rob




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to