• 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: Optimizing Character Matching
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Optimizing Character Matching


  • Subject: Re: Optimizing Character Matching
  • From: Rick Gordon <email@hidden>
  • Date: Sat, 4 Nov 2006 17:39:52 -0800

Thanks, Tim & Gary for your comments.

I have downloaded Satimage, Text Commands, and List and Record Tools, figuring that with some combination of those three additions, I'll have a better toolbox.

This may not be pertinent in the light of what's possible with those additions (which I can't really explore right now), but really, I'd prefer to phrase the question as:

Does this string contain any character in a list of known bad characters?

OR

Does this string contain any character besides [A-Za-z0-9], and does it begin with a digit?

(And not to have to do it via a character-by-character repeat loop.)

Rick Gordon

------------------

On 11/4/06 at 4:20 PM +1100, Tim Mansour wrote in a message entitled
"Re: Optimizing Character Matching":

>I'd be testing the other way round for this Rick:
>
>if " -_<>()*~" contains (character 1 of pStyleName) then set tempName to ...
>
>And having said that, I agree with Gary that you could save yourself a lot of effort with the Satimage scripting addition--or TextCommands which is Unicode aware:
>
><<http://www.satimage.fr/software/en/downloads.html>http://www.satimage.fr/software/en/downloads.html>
><<http://osaxen.com/files/textcommands1.0.1.html>http://osaxen.com/files/textcommands1.0.1.html>

------------------

On 11/3/06 at 9:49 PM -0500, Gary (Lists) wrote in a message entitled
"Re: Optimizing Character Matching":

>In human terms, what you wish to ask is:
>
>    Is this character in a list of known bad characters?
>
>
>So, just use a list of known bad characters, and compare against that using
>"is in".
>
>Here is a non-contextual example:
>
>--
>set bad_chars to {"<", ">", "(", ")", "-", "_", "*", "*", "~"}
>set this_char to ")"
>this_char is in bad_chars
>--> true


--

___________________________________________________

RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________

WWW:   http://www.shelterpub.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Optimizing Character Matching
      • From: Tim Mansour <email@hidden>
References: 
 >Optimizing Character Matching (From: Rick Gordon <email@hidden>)
 >Re: Optimizing Character Matching (From: Tim Mansour <email@hidden>)

  • Prev by Date: Re: Set creation date?
  • Next by Date: Re: Reading an utf8 file
  • Previous by thread: Re: Optimizing Character Matching
  • Next by thread: Re: Optimizing Character Matching
  • Index(es):
    • Date
    • Thread