On Wed, Feb 19, 2003 at 01:44:29PM -0600, randy matz wrote: > > In the current script that I am writeing, I used egrep to pull out a > line from returned input. I then used the - to remove parts of the > string I didn't want, but I still end up with a carriage return > (newline) at the end. How would I remove that from the string? > > > Example snippet of code is this: > > > repo = egrep(pattern:".*version.*", string:r); > > repo = repo - "<SMALL>SquirrelMail " - "<BR>"; Your code seems alright, however I'd suggest that you use ereg_replace() : repo = egrep(pattern:".*version.*", string:r); version = ereg_replace(pattern:".*SquirrelMail (.*)<BR>", replace:"\1", string:repo); -- Renaud
This archive was generated by hypermail 2b30 : Wed Feb 19 2003 - 11:54:51 PST