• 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: Help with find text command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with find text command


  • Subject: Re: Help with find text command
  • From: "Wallace, William" <email@hidden>
  • Date: Wed, 01 Aug 2007 14:24:24 -0500
  • Thread-topic: Help with find text command

Mark,

That's all you have to offer? Brute force?  ;-}

Thanks, that will do nicely since it doesn't even need to be that brutal.
The first subgroup of digits will never be more than five and the last
subgroup of digits (since it is the ISBN's check digit) will always be just
a single digit (or it can be the letter x). So I think there are only 25
possible permutations:

12345-123-1-1
12345-12-12-1
12345-1-123-1
1234-1234-1-1
1234-123-12-1
1234-12-123-1
1234-1-1234-1
123-12345-1-1
123-1234-12-1
123-123-123-1
123-12-1234-1
123-1-12345-1
12-123456-1-1
12-12345-12-1
12-1234-123-1
12-123-1234-1
12-12-12345-1
12-1-123456-1
1-1234567-1-1
1-123456-12-1
1-12345-123-1
1-1234-1234-1
1-123-12345-1
1-12-123456-1
1-1-1234567-1

So that would mean my find text command should be:

__
set foundText to find text
"[0-9]{5}-[0-9]{3}-[0-9]-([0-9]|X)|[0-9]{5}-[0-9]{2}-[0-9]{2}-([0-9]|X)|[0-9
]{5}-[0-9]-[0-9]{3}-([0-9]|X)|[0-9]{4}-[0-9]{4}-[0-9]-([0-9]|X)|[0-9]{4}-[0-
9]{3}-[0-9]{2}-([0-9]|X)|[0-9]{4}-[0-9]{2}-[0-9]{3}-([0-9]|X)|[0-9]{4}-[0-9]
-[0-9]{4}-([0-9]|X)|[0-9]{3}-[0-9]{5}-[0-9]-([0-9]|X)|[0-9]{3}-[0-9]{4}-[0-9
]{2}-([0-9]|X)|[0-9]{3}-[0-9]{3}-[0-9]{3}-([0-9]|X)|[0-9]{3}-[0-9]{2}-[0-9]{
4}-([0-9]|X)|[0-9]{3}-[0-9]-[0-9]{5}-([0-9]|X)|[0-9]{2}-[0-9]{6}-[0-9]-([0-9
]|X)|[0-9]{2}-[0-9]{5}-[0-9]{2}-([0-9]|X)|[0-9]{2}-[0-9]{4}-[0-9]{3}-([0-9]|
X)|[0-9]{2}-[0-9]{3}-[0-9]{4}-([0-9]|X)|[0-9]{2}-[0-9]{2}-[0-9]{5}-([0-9]|X)
|[0-9]{2}-[0-9]-[0-9]{6}-([0-9]|X)|[0-9]-[0-9]{7}-[0-9]-([0-9]|X)|[0-9]-[0-9
]{6}-[0-9]{2}-([0-9]|X)|[0-9]-[0-9]{5}-[0-9]{3}-([0-9]|X)|[0-9]-[0-9]{4}-[0-
9]{4}-([0-9]|X)|[0-9]-[0-9]{3}-[0-9]{5}-([0-9]|X)|[0-9]-[0-9]{2}-[0-9]{6}-([
0-9]|X)|[0-9]-[0-9]-[0-9]{7}-([0-9]|X)" in theText with regexp and all
occurrences
--

Is the ([0-9]|X) syntax okay or is there a more efficient way to say (0, 1,
2, 3, 4, 5, 6, 7, 8, 9, or X)?


Thanks again.
--
B!ll
 _______________________________________________
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/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Help with find text command
      • From: "Mark J. Reed" <email@hidden>
  • Prev by Date: Re: Akua Sweets
  • Next by Date: Re: Akua Sweets
  • Previous by thread: Re: Help with find text command
  • Next by thread: Re: Help with find text command
  • Index(es):
    • Date
    • Thread