• 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
How to crash a RegEx droplet...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to crash a RegEx droplet...


  • Subject: How to crash a RegEx droplet...
  • From: Hans Haesler <email@hidden>
  • Date: Fri, 11 May 2001 22:18:01 +0200

One of my droplets is used by our layouters to import text files
in QuarkXPress text boxes. The script does a lot of things, including
cleaning up the text.

It works nicely, since 44 weeks, for our Sunday newspaper. Three weeks
ago we introduced it to two magazines and yesterday a colleague reported
a crash (of the droplet first and, on the second try, of the system).

I tracked the problem down to the line where RegEx replaces double (or more)
spaces by one space.

The typist, instead of typing a tab, had inserted 135 spaces to position
a word in a line...

Using this simple snippet I tried to find the limit ...
---
set aSt to "a z"
set aSt to (REReplace aSt pattern "( )+( )" with " ")
-->"a z"

... and had no "success" up to 128 spaces. With 129 spaces or more there is,
at best, a crash of Script Editor (type 2 or 3). At worst, a bomb (bus error).

To prevent further problems I'll insert a new command line which replaces,
first, 20 spaces by one, pushing the limit up to 2560 spaces... unless
Leonard or Lindsey (or any other RegExpert) can point out another solution.

Hans

---
Hans Haesler | email@hidden


  • Follow-Ups:
    • Re: How to crash a RegEx droplet...
      • From: hciR nellA <email@hidden>
  • Prev by Date: prefab.com
  • Next by Date: Re: How to crash a RegEx droplet...
  • Previous by thread: prefab.com
  • Next by thread: Re: How to crash a RegEx droplet...
  • Index(es):
    • Date
    • Thread