On Wed, 7 Jun 2006, Emmanuel <[log in to unmask]> wrote:
>At 8:37 PM +1000 6/7/06, Timothy Bates wrote:
>>change "\\n+" into "\\n" in z regexpflag {"EXTENDED"} with regexp
>
>I think that Joe really needs \\r rather than \\n (he says "carriage
>return"), whence:
>
>set z to change "\\r+" into "\\r" in z with regexp
>
>(I think the regexpflag is not needed here.)
I tried to avoid changing the default regexpflag because of the docs.
warning as regards memory when used with large pieces of data.
The syntax that achieved my desired goal is a two-step:
set v to change "^\\r+" into "" in v with regexp
set v to change "\\r$" into "" in v with regexp
(the second line catching any stray trailing CRs). My thanks to
Timothy and Emmanuel for pointing me in very much the right direction.
Cheers!
Joe
Selected from Ambrose Bierce's "Devil's Dictionary":
EAVESDROP, v.i. -- Secretly to overhear a catalogue of the crimes and
vices of another or yourself.