Move tte date to end of text

Hi People ! and Need Your Help!

I try to use the action of MOVE and SWAP but not really works

I need to move the date to te end of text plus a [ _ ] before date

The Text Some times ending at number or point and the length of the text is variable

[2026.07.05] Nat creative_Your Rent_E2025_San Jose Calif.
[2026.05.01] Just for you and my Show case_4515
[2026.01.01] Tiger king no eat candys, just avocados from my yard

And I need like this

Nat creative_Your Rent_E2025_San Jose Calif._[2026.07.05]
Just for you and my Show case_[2026.05.01]
Tiger king no eat candys, just avocados from my yard_[2026.01.01]


I searched the forum before asking, but I didn't find anything similar.


Many Thanks !
Reply to #1:

Hi George! Good to see you!

Actually you can almost do it with swap, but then there's some clean-up left to do. But you can do it all with one replace method and regular expressions. Don't worry if you don't understand them, but in case you'd like to learn more about them you can check out https://www.advancedrenamer.com/user_guide/regular_expresion s
I don't think there's anything in the following that's not covered there, so that's a good place to start.

In the meantime, let's put out your fire. :)

One Replace method, like this (leave out the quote marks):

Replace: "^(.*?)\] (.*?) ?$"
Replace with: "$2_$1]"
Occurrence: All (or 1st)
Use regular expressions: CHECKED
Apply to: Name

That should get you where you want to go, my friend.

Here's a screenshot:
https://drive.google.com/file/d/1UfqU9BUvnplll2ABKHcEJih6Ou3 bf9g4/view?usp=sharing

Best,
DF
Reply to #1:
Hi, I had prepared a response, but then I noticed that Delta Foxtrot had already replied.
I’ll post it anyway, even though DF is more experienced than I am when it comes to regular expressions.
-----
You can obtain your results using the replace method with a regular expression.
The date in the square brackets matches this expression: \[([^\]]*)\]
For the second part of the filename, which is separated from the first by a space, I've used (.*)
To replace the second part of the filename with the first, you can use the following:
\2_[\1]
this contains the underscore and the square brackets.

In the method:

Replace: \[([^\]]*)\] (.*)
Replace with: \2_[\1]
Use the regular expression: yes

See the following picture:

https://i.postimg.cc/TYCmKSjr/IMG-209.png
Reply to #2:
Gracias Delta
And what if I have a copy of the regular expressions on my desktop, but I still don’t quite understand how to use the parentheses and other symbols?
And I was able to move it, but with a ( ] ) in an unwanted spot.

And I’m going to put your formula into practice!



Thanks.
Reply to #3:

Styb

Thanks,

And it never hurts to have other options.

I might give it a try; it could help me start to understand how the regular expression language works.


Almost everything I do stems from reading other people's posts and taking what I think might be useful to me—though it doesn't always work out.


Gracias !
Reply to #4:

Hi George,

Not sure what you mean by a bracket in an unwanted spot.
At any rate, just let us know if we can help you with anything.

Regular expressions take some time to comprehend. Styb and I didn't just start writing \d{3,5}(px|p) in a day, or week, but it doesn't take long and it's not very hard to get the basics.

The caret "^" just means "at the start of the phrase or filename". Think of parentheses as containers. They just hold pieces of your phrase that you might want to use later. When you are ready to reuse them, identify them with a "$" or a "\", and add the right number, counting them in the order they originally appear. So in the filename

[2026.01.01] Tiger king no eat candys, just avocados from my yard

The regex "^(.*?)\] (.*?) ?$" tells you that you have two containers. Now think of them as "$1" and "$2". The caret tells us that the first one HAS TO be anchored at the start of the filename. "." just means "one character, doesn't matter which"; the asterisk/star "*" means whatever comes before it can appear any number of times. So ".*" means any character any number of times, from zero up. But we don't want to be so greedy and take up the whole filename, so the "?" after the "*" tells the star not to be too greedy and look out for the next character(s) in the regex (in this case "\] ") and stop before it eats them too. Oh, by the way, the "]" character has special meaning to Mr. Regex, so the backslash "\" before it says "this is just a normal character, not a symbol that means something to you".

I guess in this case regex is Tiger king, "^(.*?)" is avocados, and "\] " is candys. :)

I've got to save some secrets (and too much regex in one dose causes severe headaches), but that should get you started.

Best,
DF


Reply to #6:

Hi ! Mr. Delta

When you have tried many times without success, it is time to ask for help !!!

And perhaps my problem is that I don’t quite grasp how or where to place the ( ) [ ]
and when I see that they combine symbols like the one you presented "^(.*?)\] (.*?) ?$"

It drives me crazy. I use it, but it bothers me that I don’t understand why it works!

Still, I enjoy using the program. Especially when only use one finger on each hand to type, being able to correct or modify a phrase and have that change applied 20 times over is a huge time-saver !

Many thanks for all your help !

Reply to #7:

Hey George,

Don't let it make ya crazy my friend, it's not all that easy to grasp at first; on the other hand, it's not all that hard either. You can do it. And as a wise man once said, "It's the results that matter." So you got your filenames fixed, that's the main thing.

In case you're still interested, let's go through that expresssion "^(.*?)\] (.*?) ?$" one step at a time. We'll use this: "[2026.07.05] Nat creative_Your Rent_E2025_San Jose Calif. "
as an example. I'll be talking about consuming characters; that just means the regex engine is looking at that, specific character or group of characters.

The first symbol, "^", tells the regex engine to start at the very start of the text. It consumes no characters, just a clue where to begin. The next part, "(.*?)", tells the engine to reserve a container in memory to remember what's inside the parentheses for later use. The ".*?" part inside the parens says to consume any characters the engine encounters. That is, "." stands for "any character one time" and "*" says "consume as many characters as available". We don't want the engine to eat the whole filename so we add "?". It's a sign, attached to the "*", that we want the engine to stop being greedy when it sees the following character "\]" (and remember, the backslash tells the engine that the following character is just a character, not a special symbol). So in this case the engine will consume "[2026.07.05" from the filename and put it in box number one. When it encounters the "]" it stops putting stuff in the box. It consumes the "] " then starts another box, again eating characters and putting them in box number two, until it encounters the next stopper. In this case it's a space, followed by the "end of text/filename" anchor, "$". But the space has a "?" after it, which makes it optional (because if it's not following another "quantifier" like "*", the "?" means (the one character immediately before me is optional" So the second box contains whatever comes after the first "] " the engine encounters, except a space if there's one at the end of the filename (as there was in this example).

So now the engine has eaten the whole filename, and spit out two parts into boxes #1 and #2. Of course that assumes it found something to put there; otherwise it would ignore whatever doesn't fit the pattern. For instance, if your filename was "[2026.07.05" it would put the whole thing into box 1. If there was no "] " (bracket plus space) in the filename it would also put the whole thing in the box. In those cases box 2 would contain "" (an empty string). Anyway, we now need to tell ARen what to put back into the filename. That would be box 2, then a character to separate them (the underscore), then box 1. When making replacement strings you can use a "$" or "\" to recall a box, followed by its number in the order (left to right) that it was created. The final "]" wasn't in the box, since I used it to tell the engine where to stop box 1, so we add it at the end of the filename, and Shazam!, we have the new filename!

OK, you're probably not reading this anyway; I'm going back to cold coffee and debugging. Or a nap. :)

Best,
DF
Reply to #8:
Of course I read it!
And not only that , I also take screenshots to refer back to later.

Many Thanks !
Reply to #9:

LOL! Most people don't seem to come back after they get an answer... you are one of the few I think! :)

You're welcome my brother. Keep those questions comin'!

Best,
DF