MACSCRPT Archives

June 2006

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Joe Barwell <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Thu, 8 Jun 2006 22:50:04 +1300
Content-Type:
text/plain
Parts/Attachments:
text/plain (31 lines)
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.

ATOM RSS1 RSS2