I'm trying to figure out the best way to print out part of a tag, in this case the Caption-Abstract. In the tag, there's some data I want to print out that's between an end bracket+whitespace and a whitespace+start bracket ([bbcode] Data I want [/bbcode]). I'm currently using this command
exiftool -p "${caption-abstract;s/.*?\]\s(.*?)\s\[.*/$1/s}" <file>
and that sorta feels messy and I'm wondering if I'm missing an easier solution due to my lack of Perl knowledge.
Any thoughts/suggestions?
Sometimes regular expressions can be messy. The only alternative I can suggest right now isn't much better:
"${caption-abstract;/\]\s*(.*?)\s*\[/;$_=$1}"
- Phil
Sounds good, thanks.
I was just thinking I might have been missing a simpler solution.