• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Top 20
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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>)

  • Prev by Date: Re: Post Data
  • Next by Date: Kernel Panic running script that launches Classic
  • Previous by thread: Top 20
  • Next by thread: Re: Post Data - CAN use POST method
  • Index(es):
    • Date
    • Thread