Searching within parentheses and moving only the numbers

I want to move the BPM numbers only to the BPM field from the file title tag.

I know that \s((.*)) will remove all inside and the parentheses also.

I can't seem to figure out how to search within and only move the numerical data to the bpm field without the text. Since one file has 3 digits and the other 2, I'm not sure how to do this.

Below are two examples:

Horse & Carriage (feat. Mase) (100 bpm)

Woo Hah! (96 bpm)

Can someone help me figure out how to do this?


This give you the numbers only:
$regexp(%title%,.+((\d+) bpm),$1,1)

And this the rest of the title without the parentheses:
$regexp(%title%,(.+) (\d+ bpm),$1,1)

If you want to format both fields in one go:

Action: Guess Values
Sourceformat: $regexp(%title%,(.+) ((\d+) bpm),$1+++$2,1)
Guessingpattern: %title%+++%bpm%

oh my.....

brilliant and exactly what I was looking for.

I used it as the action, it puts the numbers into the field and nuke it off the title cleanly.

Thank you very much. I will try to understand the script a bit better. I understand the %% operators, the \d operator, and the $ operator, just not the contruction of the syntax to execute the task.

But it is certainly what I needed!


Ok and to add a monkey wrench I have the same issue with different format:

Mama Said Knock You Out-102

Always On Time-97

Tried to adjust source format to:

$regexp(%title%,(.+) ((\d+)-),$1+++$2,1)


$regexp(%title%,(.+) (\d+)-,$1+++$2,1)

but neither worked, I guess I still don't understand enough about the script action.

What am I missing?




I don't know what you are missing. Both of your strings still have the litteral parentheses (or parts of them) in in them ( and ).
They are not needed here.
And you write -(\d+) but in the examples it's -102 and -97 . With the minus on the left side of the digits.

Your right, that is my lack of knowledge of that area, I was trying to see if I could figure out what to do to fix it without the knowledge of the consequence of the actions I was doing.

I've learned a lot, hopefully this will add to that knowledge base. It works the way I need it, thank you once again!