• 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: looking to correct Smiles measuretext command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: looking to correct Smiles measuretext command


  • Subject: Re: looking to correct Smiles measuretext command
  • From: Robert Poland <email@hidden>
  • Date: Sat, 25 Jun 2011 22:24:45 -0600

Thanks Chris,

This makes no sense to me, see examples below.

set foundString to fnd("[\s]+", str, true, true, true) -->error

--script
on fnd(findStr, dataSource, caseSensitive, allOccurrences, stringResult)
try
set findResult to find text findStr in dataSource ¬
case sensitive caseSensitive ¬
all occurrences allOccurrences ¬
string result stringResult ¬
with regexp
return findResult
on error
return false
end try
end fnd
------------------------------------------------------------------------------------------------
set stringCount to 0
-- set str to "Broadband2Go - 3G Mobile Broadband Service | Virgin Mobile"
set str to "Your Broadband2Go Account Number and Programming Instructions"
-- set foundString to fnd("[A-Z0-9space]+", str, true, true, true) --> 15 - should be 18
-- set foundString to fnd("[A-Z]+", str, true, true, true) --> 7 - OK
-- set foundString to fnd("[A-Z0-9]+", str, true, true, true) --> 7 - should be 9
-- set foundString to fnd("[[A-Z],[0-9]]+", str, true, true, true) --> 7 - should be 9
set foundString to fnd("[NA ]+", str, true, true, true) --> 6 - should be 18
set stringCount to length of foundString


Robert Poland - Fort Collins, CO



 _______________________________________________
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: looking to correct Smiles measuretext command
      • From: Christopher Stone <email@hidden>
    • Re: looking to correct Smiles measuretext command
      • From: Thomas Fischer <email@hidden>
References: 
 >looking to correct Smiles measuretext command (From: Robert Poland <email@hidden>)
 >Re: looking to correct Smiles measuretext command (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: looking to correct Smiles measuretext command
  • Next by Date: Re: looking to correct Smiles measuretext command
  • Previous by thread: Re: looking to correct Smiles measuretext command
  • Next by thread: Re: looking to correct Smiles measuretext command
  • Index(es):
    • Date
    • Thread