AppleScript名:ASOCで英数字以外を削除して返す |
— Created 2015-12-02 by Takaaki Naganoya — 2015 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" set aStr to "<< 98158999992aazaaZZZ >>" set bStr to returnNumberAndAlphabetCharsOnly(aStr) –> "98158999992aazaaZZZ" on returnNumberAndAlphabetCharsOnly(aStr) set anNSString to current application’s NSString’s stringWithString:aStr set anNSString to anNSString’s stringByReplacingOccurrencesOfString:"[^0-9A-Za-z]" withString:"" options:(current application’s NSRegularExpressionSearch) range:{0, anNSString’s |length|()} return anNSString as text end returnNumberAndAlphabetCharsOnly |
More from my site
(Visited 20 times, 1 visits today)