.------[ Paul Kraus wrote (2003/02/03 at 10:29:14) ]------
 | 
 |  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);
 |  
 `-------------------------------------------------

    Try this regex instead: 

    s/(?:^\s+|\$+|\s+$)//g

 ---------------------------------
   Frank Wiles <[EMAIL PROTECTED]>
   http://frank.wiles.org
 ---------------------------------


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

Reply via email to