Greetings Free2flyph. Im guessing you meant the colored-regex from RegexNinja?
Im almost said he just makes a typo, so then fixing the '[01]' into '[0123]'.
But then after studying, Im noticed that its to conduct dates like... dd-mm-yyyy.
And your example filenames do instead present the dates like...... mm-dd-yyyy.
So finally realized that '[01]' is to forbid months starting with '2' or higher.
Thanks for posting because Im trying to find this it forever, but only saved Page-3 in the bookmarks!
At first, Im trying to copy that format to only conduct dates like mm-dd-yyyy, but then realizing...
How can the regex know if "02-01" is really "Feb 01" or "Jan 02", lol.
This a good example why Im thinking its best to make a new post with example NowNames.ext ===> NewNames.ext
This way the users are not getting confused when others come with different request, but also making typos.
At first, 'FrequentlyPuzzled' says he wants to change the names like (filename)mm.dd.yyyy.
But since he is not posting NowNames.ext ===> NewNames.ext, he must re-explain this twice.
So then 'Hasse' is guessing five different regexs until finding the exact solution.
Then 'Mwsasser', 'Pepemendes', and 'Sandma85' come with more requests, but giving good examples.
So their solutions come quickly, but maybe confusing other users looking at the original post.
Then 'Jvanheck2' comes to request "Foto MM-DD-YYYY HH MM SS.jpg" ===> Foto YYYY-MM-DD HH MM SS.jpg
So 'Therube' quickly provides a solution, but then 'Jvanheck2' said he makes a mistake, and still not giving any examples.
Then saying he meant "Foto DD-MM-YYYY HH MM SS.jpeg" ===> "Foto MM-DD-YYYY HH MM SS.jpeg" but makes another mistake!
So really he needed: "Foto DD-MM-YYYY HH MM SS.jpeg" ===> "Foto YYYY-MM-DD HH MM SS.jpeg (no example, and forgets Foto).
But again with no examples, so then 'RegexNinja' also guessing different regexs for the latest request.
So then 'RegexNinja' presenting his own "Results", because 'Jvanheck2' never does provide any samples.
Im getting so confused, I must create many sample filenames, before finally understanding who is wanting what.
So if you already renamed with the colored-regex, Im really not know how to fix, except with also destroying others?
There should be an advanced regex to conduct the 'exact opposite', but so far Im not finding it anywhere.
If you want a 'v2' regex to convert 'm-dd-yyyy' or 'mm-dd-yyyy' ===> 'yyyy-mm-dd', the Match and Replace is like...
- Code: Select all
(\b|_)(\d-\d\d-)(19|20)(\d\d)(\b|_)/g(?X)(\b|_)(\d\d-\d\d)-(19|20)(\d\d)(\b|_)/g
${1}0$2$3$4$5(?X)${1}$3$4-$2$5
But its not advanced, so never recognizing 'm-dd' from 'd-mm', or 'mm-dd' from 'dd-mm'.
Its just inserting '0' if needed, then rearranging the numbers like your explanation.