Re: Top 20
Re: Top 20
- Subject: Re: Top 20
- From: Christopher Nebel <email@hidden>
- Date: Wed, 2 Jan 2002 12:39:44 -0800
On Wednesday, January 2, 2002, at 09:10 AM, Anthony Wilson wrote:
Regarding Regex:
Can all of its functions be replicated by regular expression commands to
terminal or 'do shell script'? While these functions are near the top
of my
list, if they are native to X then couldn't they be considered vanilla?
Yes, but I'd consider it a cheesy hack at best. It's clearly possible,
but incredibly expensive even compared to a normal scripting addition,
let alone something built in. For example:
set s to "foo foo foo"
do shell script "echo -n '" & s & "' | sed -e 's/foo/bar/g'"
--> "bar bar bar"
That worked, but it had to call a scripting addition, spawn three new
processes, and do file I/O between them all. Trust me, you don't want
to do this too often -- doing it just 100 times on my machine took 12
seconds.
--Chris Nebel
AppleScript Engineering
References: | |
| >Top 20 (From: Anthony Wilson <email@hidden>) |