Hi,
can I manipulate variables with regular expressions?
For example, the regexp [^\.]{0,255} to strip everything from the first "." and limit the result to 255 characters?
This would be handy to get automated "headlines" from "descriptions" in a metadata template:
"Foobar bridge in Hamburg. The bridge is made from steel. Night shot." is then converted to "Foobar bridge in Hamburg".
Not a big deal if it isn't possible since the result has to be reviewed, anyway. And I can do it also with an exiftool one-liner.
Variables allow regular expressions for filters. No regexp replace.
But maybe I can add a before / after / between with regep support for IMatch 2021. May be useful for many...
Feel free to add a feature request.
Quote from: Mario on March 13, 2021, 07:33:29 PM
Variables allow regular expressions for filters. No regexp replace.
Thanks for confirming that I didn't miss something in the docs.
ExifTool
-headline<${description;s/([^\.]{0,255}).*/$1/} seems to do the job.
Quote from: Mario on March 13, 2021, 07:33:29 PM
But maybe I can add a before / after / between with regep support for IMatch 2021. May be useful for many...
I don't know the capabilities of the RE engine in IMatch, but wouldn't it be simpler to implement (and more powerful) to make the RE matching groups accessible?
For example, I use ExifTool to repair weird (sorry, US readers) dates in PDF files with
s[(\d{1,2})/(\d{1,2})/(\d{4})][$3:$1:$2]
Most users don't even understand regular expressions, me included.
This seems to be a very special use case. You can do it with ExifTool. Feel free to add a FR but I doubt more than one user will ever need this.