• 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: looking for regex help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: looking for regex help


  • Subject: Re: looking for regex help
  • From: Christopher Stone <email@hidden>
  • Date: Fri, 25 Nov 2011 13:26:41 -0600

On Nov 25, 2011, at 12:30, Robert Poland wrote:
As usual I guess I wasn't clear.

From the Regex info the "^" was supposed to indicate the start go the filename.

The {"{1, 1, 2}-"} was supposed to add a two digit number, starting at 1 and incrementing by 1, to the start of the filename.

Even when I change the "^" to a "1" in the file name, which all filenames start with, nothing gets changed.
______________________________________________________________________

Hey Bob,

Well yes.  I showed you how to do that.

Here's a couple of simple examples:

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

set fileName to "One.jpg"

set newFileName to change "^" into "01-" in fileName with regexp

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

set fileNames to {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"}

change {"^on.*", "^f.*"} into {"•••", "•••"} in fileNames with regexp

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

The list-form of 'change' works on a one-to-one ratio - each list-index-item-find corresponds to the matching replace-item in the second list.

You cannot use this to directly create a numerically incremented list.

--
Best Regards,
Chris

 _______________________________________________
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: 
 >looking for regex help (From: Robert Poland <email@hidden>)
 >Re: looking for regex help (From: Christopher Stone <email@hidden>)
 >Re: looking for regex help (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: looking for regex help
  • Next by Date: Weird feature or???
  • Previous by thread: Re: looking for regex help
  • Next by thread: Weird feature or???
  • Index(es):
    • Date
    • Thread