Copy inside TITLE () data to file name with regexp()

Hi Guys,

I'm trying to figure out how to capture a piece of the title tag that I create with my scripts. It denotes video resolution in the title and I want that to be captured by the file rename.

My files names should look like this:

VIDEO FILE--HD MOTION BACKGROUND (8) (1080P)--RESOLUTION(1080P).mp4

So for each file the title is appended and will have its own resolution value that could be anything from 1080P to 720P to etc. looking like this in the title field:

HD MOTION BACKGROUND (8) (1080P)

So my tag to file rename all works but the $regexp part shown below.

I want to capture the 1080P inside the parenthesis and dump it into the the file name since is a wildcard for all my MP4s.

What am I doing wrong? I don't use regexp much, so I assume it's a syntax problem, but I'm not getting a syntax error in the preview file name.

$caps2($if2(%artist%,NULL))--$caps2($if2(%title%,NULL))--RESOLUTION($regexp(%title%,\d*(.*)))

Any thoughts?

TY.

If you do not get any syntax errors, it should be a logical error. So where do you have the problems?

I've attached an image to show that I would expect to see the 720P inside the name, but since I'm using \d, it would only be the 720 without the P, but as you can see, there is nothing in the () at all.


I think that this part
$regexp(%title%,\d*(.))
should read
$regexp(%title%,'.
((\d+))',$1p)

$regexp('HD MOTION BACKGROUND (8) (1080P)','^.*\((.+P)\)$','$1') ==> '1080P'

DD.20170224.1104.CET

Hi Guys,

I've tried both solutions, I've attached screenshots to show the result.

One result still has entire title and 720 included.

Other result also puts 1080 instead of the wildcard change.

As you can see, not all my files are 1080, so I'm trying to have it copy only the numbers minus the P and I can format the rest. I'm only trying to capture the digits.

There my be other () like (Clean) or (Dirty) that I don't want to capture if it was in the title also. I just want to capture the numbers.

Any thoughts on how to tweak?

TY.



Your screenshot shows that you apparently did not understand my proposal and therefore you have applicated it in no good way.

Here is another example, which fetches the number string at the left side from the letter "P" within the rightmost () round bracket clamb.

$regexp('HD MOTION BACKGROUND (8) (1080P)','^.*((\d+)P)$','$1') ==> '1080'

You have to adapt the formatstring resp. the regular expression to work on the correct tagfield,
e.g.

$regexp(%TITLE%,'^.*\((\d+)P\)$','$1')

DD.20170224.1735.CET

Well part of it was I wasn't entirely sure since the first part was the fix part of the single file string. So my understanding was limited. Seeing the additional example you provided, it has become clear on how to do this and do it correctly.

Thank you for the additional help!

Chris