string cleaning

Alex Rice alex at mindlube.com
Wed Nov 12 10:07:13 CST 2003


On Nov 12, 2003, at 7:04 AM, Rob Cozens wrote:
>
> These performance hits will populate my scripts for some time to come, 
> Alex...at least until I learn (and find readable) regular expression 
> syntax.

I understand. regex is kind of bizarre sometimes. I'll break it down 
for you- I am assuming that's OK :-)

  "([\000-\037]|[\177-\777])+"

( ) encloses a group
| means "OR"
[] is a character class
\xxx-\yyy means "the range of characters with ascii octal values from 
xxx to yyy
+  means one or more of the preceding group

BTW "man ascii" on Unix shows the low ascii table in octal, decimal and 
hex.

transcript's replacetext() replaces all instances of the regex with the 
parameter in this case empty, and returns the resulting string.


Alex Rice <alex at mindlube.com> | Mindlube Software | 
<http://mindlube.com>

what a waste of thumbs that are opposable
to make machines that are disposable  -Ani DiFranco



More information about the use-livecode mailing list