First number in title

Advanced Renamer forum
#1 : 05/03-22 14:38
Henry Cabrera
Henry Cabrera
Posts: 9
Hi, how can I insert the first number found in the tittle?
Ex: "my new movie 2021"
I want renamer to recognize the first number and add it at the beginning.
I don't want "word: x" I need another one


05/03-22 14:38
#2 : 05/03-22 15:19
David Lee
David Lee
Posts: 1125
You are not making any sense!

Do you mean that you want to copy the fist number occurring in the video title from the metadata within the file and add it to the beginning of the filename? If so do you want the number "2021" or just the first digit "2".

Otherwise just give us an example!


05/03-22 15:19
#3 : 12/03-22 14:24
Henry Cabrera
Henry Cabrera
Posts: 9
Reply to #2:
Yes I'm sorry. What I want is this:
The name of the movie is uncharted 2022.mkv
I want it to be like this:
2022+uncharted 2022.mkv


12/03-22 14:24
#4 : 12/03-22 15:02
David Lee
David Lee
Posts: 1125
Reply to #3:

Replace: ([^\d]*([\d]*))
with: \2+\1
Occurrence: 1st
Use regular expressions

Explanation of the regular expression:

[^\d]* matches a string of any non-digit characters starting from the beginning of the filename

then [\d]* matches the first string of digits - stopping before the first non-digit character (or end of filename)

The nested parentheses indicate that the overall match will be saved in the variable \1 and the number in \2



12/03-22 15:02 - edited 13/03-22 11:56
#5 : 12/03-22 17:51
Henry Cabrera
Henry Cabrera
Posts: 9
Reply to #4:
Result:
2+uncharted 2022.mkv
Close, I need the entire '2022'
Can you make that?
Thank you


12/03-22 17:51
#6 : 12/03-22 18:00
Henry Cabrera
Henry Cabrera
Posts: 9
Reply to #4:
Nvm
There was a typo I didn't notice
Replace: ([^\d]*(\d]*))

I missed the [\d]
It's working now. Thank you very much


12/03-22 18:00
#7 : 12/03-22 18:02
Henry Cabrera
Henry Cabrera
Posts: 9
Reply to #6:
Final expression would be like:

Replace: ([^\d]*([\d]*))
with: \2+\1
Occurrence: 1st
Use regular expressions

Works just great! Thx


12/03-22 18:02
#8 : 13/03-22 09:12
David Lee
David Lee
Posts: 1125
Reply to #7:

Sorry about the typo - at least it was correct in my explanation!


13/03-22 09:12