Re: Grep pattern to split a string
Re: Grep pattern to split a string
- Subject: Re: Grep pattern to split a string
- From: Shane Stanley via AppleScript-Users <email@hidden>
- Date: Mon, 9 Sep 2019 23:39:57 +1000
On 9 Sep 2019, at 10:02 pm, Bert Groeneveld via AppleScript-Users
<email@hidden> wrote:
>
> Is it possible to split a string on a grep pattern of 3 digits?
It's pretty simple using my RegexAndStuffLib:
use AppleScript version "2.5" -- macOS 10.11 or later
use scripting additions
use script "RegexAndStuffLib" version "1.0.5"
set myString_to_split to "Blue123Green461orange998White551Red"
set theResult to regex split myString_to_split search pattern "\\d{3}"
--> {"Blue", "Green", "orange", "White", "Red"}
Download it here:
<https://www.macosxautomation.com/applescript/apps/Script_Libs.html
<https://www.macosxautomation.com/applescript/apps/Script_Libs.html>>
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
_______________________________________________
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