• 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: Grep pattern to split a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Grep pattern to split a string (From: Bert Groeneveld via AppleScript-Users <email@hidden>)

  • Prev by Date: Grep pattern to split a string
  • Next by Date: General question about InDesign applescript
  • Previous by thread: Grep pattern to split a string
  • Next by thread: General question about InDesign applescript
  • Index(es):
    • Date
    • Thread