[KPhotoAlbum] Multiple versions of an image

Andreas Neustifter andreas.neustifter at gmail.com
Wed Dec 8 22:59:33 GMT 2010

Hi Aleksi!

On 8 December 2010 23:09, Aleksi Halkola <halkola at gmail.com> wrote:
> I found a solution that I think will work pretty well for me. I took
> inspiration from http://www.hardakers.net/kphotoalbum/#sec-4.2,
> I used the following settings:
> "File versions search regexp:"
> (.*)_v[0-9]*\.(.*)
> "Original file replacement text:"
> \1.nef
> [...]
> I learned
> regular expressions only this evening so if anybody knows how I can catch
> both dsc_8237.jpg dsc_8237_v2.jpg as versions of dsc_8237.nef I'd be very
> happy.

Those regular expression do not need to match the whole file, mine for
example are "_v[0-9]*\." and "." (a single dot). This way one can
insert a version between the file name and the extension and this file
is then recognised as new version of an old file.
(This is a little fiddly, it assumes that the filename has only one
dot in it, which is the case with my files.)

I was not aware of the regular expression supporting named groups, so
in this case maybe "(.*)_v[0-9]*\.(.*)" and "\1.\2" would work? (The
two "(.*)" each form a group of characters that can be accessed in the
second expression as \1 and \2. At least it seems that this is
possible from your example.)

Hope that helps,


More information about the Kphotoalbum mailing list