Using regex with Exiftool

Started by philbond87, July 22, 2020, 10:05:24 PM

Previous topic - Next topic

philbond87

Not sure how I screwed up missing equals sign – I tried to just copy and paste! I should have caught that.
The concatenation operator as a substitute for quoting those variable worked just fine and kept me from having to escape them.

Thanks again, much appreciated.

philbond87

So I'm close.

This is getting the result I'm looking for:
-transmissionreference<${filename;m/(\d{6}).*_([A-Z]{2,})_.*?([iwOSEV]*\d{6})/;$_$1$2$3}

However I would like to remove "w" and "E" in the last group, if it occurs. (I need them in the regex to identify the files but need them removed if they are present.)

I thought that something like this, in the last group, would work, but it doesn't:
?([iwOSEV]*\d{6};tr/w//;tr/E//)

philbond87

I believe I've figured it out.

Taking it out of the variable seems to accomplish what I'm trying to do:
-transmissionreference<${filename;m/(\d{6}).*_([A-Z]{2,})_.*?([iwOSEV]*\d{6})/;$_$1$2$3;s/w//;s/E//}