Re: How best to extract digits from a string?
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
---------------------------------------------------------------