Author Topic: Regex/Regular Expression support in Find and Replace?  (Read 2916 times)

Offline justatechguy

  • Newcomer
  • *
  • Posts: 2
    • View Profile
Regex/Regular Expression support in Find and Replace?
« on: March 22, 2012, 12:02:33 PM »
I have been tasked with figuring out a way to programmatically modify existing IPTC metadata in sets of photos on local Mac OSX machines in preparation for use in a web slideshow tool.  We have Photo Mechanic licenses (v4.6.7) and a variety of machines (all Macs) but the person who wants this is running OSX 10.5.8.  If we can get it working on his machine, we can deploy the solution to everyone else easily enough.

The easiest approach we've thought of is to write a saved regular expression.  We've found the "Find and Replace..." dialog but none of the documentation we've found indicates that it supports regexes.  If it does support regexes, what format does it accept/require?  I'm asking since every regex implementation I've ever run across seems to do things differently.  If it doesn't support regex replacements, do you have any alternate recommendations?

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Regex/Regular Expression support in Find and Replace?
« Reply #1 on: March 22, 2012, 12:13:14 PM »
I have been tasked with figuring out a way to programmatically modify existing IPTC metadata in sets of photos on local Mac OSX machines in preparation for use in a web slideshow tool.  We have Photo Mechanic licenses (v4.6.7) and a variety of machines (all Macs) but the person who wants this is running OSX 10.5.8.  If we can get it working on his machine, we can deploy the solution to everyone else easily enough.

The easiest approach we've thought of is to write a saved regular expression.  We've found the "Find and Replace..." dialog but none of the documentation we've found indicates that it supports regexes.  If it does support regexes, what format does it accept/require?  I'm asking since every regex implementation I've ever run across seems to do things differently.  If it doesn't support regex replacements, do you have any alternate recommendations?

No regex support in the Find/Replace panels.

I'd suggest using something like ExifTool with some scripting from the terminal.

-Kirk

Offline justatechguy

  • Newcomer
  • *
  • Posts: 2
    • View Profile
Re: Regex/Regular Expression support in Find and Replace?
« Reply #2 on: March 22, 2012, 01:35:51 PM »
Aw.  Slightly disappointed.  Would have been really nice - maybe something to add for a future release?  In the meantime, I guess it is an AppleScript drop + exiv2 + some hodgepodge command-line stuff.

BTW, thanks for the prompt response.  It is much appreciated.

Offline berijan

  • Newcomer
  • *
  • Posts: 5
    • View Profile
Re: Regex/Regular Expression support in Find and Replace?
« Reply #3 on: March 23, 2012, 04:21:13 AM »
I would have loved the possibility to use RegEx in conjunction with variables. For example when using FTP and the PATH is made up from some vaiables and the varaible values contains national charachters that is not allowed in filenamnes the it had been nice to use RegEx to filter and exchange charachters according to your own rules.