• 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: How best to extract digits from a string?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How best to extract digits from a string?


  • Subject: Re: How best to extract digits from a string?
  • From: Larry McMunn <email@hidden>
  • Date: Sat, 28 Apr 2001 20:50:33 -0400

Why not use the Regex scripting addition like this:
---------------
set someCopy to "Date: Fri, 27 Apr 2001 19:44:38 -0400"
set someCopy to REReplace someCopy pattern "(\\a|\\p|\\s)" with ""
--resulting in "2720011944380400"
---------------
Regex is very powerful for working text:
In the above example,
"\\a" finds alpha characters,
"\\p" finds punctuation, and
"\\s" finds white space
and each is replaced with "" --an empty string

Good Scripting! :-)

Larry McMunn
President

McMunn Associates, Inc.
Specialists in automated Data Visualization thru Apple products
Collingswood, NJ

(856) 858-3440

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


  • Follow-Ups:
    • Re: How best to extract digits from a string?
      • From: Paul Skinner <email@hidden>
  • Prev by Date: Re: Ok now that I've got MacOS X
  • Next by Date: Re: How best to extract digits from a string?
  • Previous by thread: Re: How best to extract digits from a string?
  • Next by thread: Re: How best to extract digits from a string?
  • Index(es):
    • Date
    • Thread