I managed to create a regex that -seems- to look fine when tested with a 3rd party tool
but doesn't work as expected in the rename panel.
It is a kind of 'nested' regex with pipes, when matched this or that or that then ..
I want to move files into folders named after the filenames. However the names do have dates added in some variety, like
dd-mm-yyyy hhmm to just ddmmyyyy, just before the extensions.
the regex matches various date/time formats alright, but in the rename panel only one or two files are 'handled'
the other files seemingly are not 'matched'.
I can only conclude that rename stumbles over the nested string?
Could that be right?
Have no idea...
No offense meant, but if so, then I know and can stop spending time on trying to make it work and rather create different presets.
(yeah .. it is crappy i know, I am way... way behind of even the shadow of what folks here can accomplish)
I gave it a try to have 1 rename, instead of a few, that would handle moving (or copying) files to a folder named after the filename without date-time stamp.
Example: a file named "The last filename then-06102016 1614.txt"
would go into a folder "The last filename then"
Dates are basically at the end, before the extension.
but in the rename the date-time isn't added, it isn't 1 group in my regex.
hope the idea of what I am trying to accomplish is clear..?
it not let me know.
Both Opus and the regex tester you are using seem to be doing the same thing, so I'm confused as the first post said they were doing different things and wanted to know if Opus was more limited.
So the problem is you want to include the date in the new names, and it isn't being included? You're only using \1 (or $1) in the replacement, and the first group is the (.+) at the start. That first group look like it matches everything before the date.
\2 or $1 would be the date part.
Or you can simply use \0 to include the entire original filename in the replacement. So \1\\0 would effectively move the file into a folder (named after the part before the date) and not rename the file itself at all.
@Leo that regex tester is RegexBuddy -- the best in the field. I love that program.
@opw62 man, what a coincidence!
Unless it was your twin, I believe we spoke yesterday on the RB forum with a regex working on the exact same test input.
What are the odds? Remember when I asked you what your file manager was? I was hoping it was DO. Truly thrilled to see that we're both Opus men.
FYI there are two regex flavors in DO. If you work in the regex pane, you're using TR1, which has some limitations, such as the lack of lookarounds. If you're working inside a rename script, you're working with JavaScript regex, which has other limitations. Either way you can get loads done with regex in Opus.
Tangent: For some years I've been hoping for DO to switch to PCRE because of its sheer power, but I don't think that's going to happen anytime soon -- a niche request. But more and more tools are using the PCRE library -- to name a few: Apache, MariaDB, Notepad++, AuthoHotkey, TextPipe Pro... If you're looking for an external regex library that's the gold standard. On the Windows side the cmake files are very good, I compile the provided utilities with every release.
@opw62
You asked a question on a different forum but under your profile in this forum you have disabled the "PM" button, so I am replying on this thread. (Have a look below my name to see the PM / message button.) If you choose to enable you can interact with other users more privately.
You can actually "grep" PDF files from within Opus. In the Advanced tab, select the "Contains" filter.
I've also found that Agent Ransack is very good. I've hard-wired a shortcut for it to launch with Win + Sh + /, which is similar to the shortcut for Search Everything (Win + /). Search Everything is great for searches by filenames, but not by contents.
@playful - thanks for the above.
As for PM : I am not sure... if my memory serves me well, PM's were disabled (already quite a while ago?)
I do see you and others have this "Contact: plus balloon" at their profile. I don't see that under my profile on the forum, but
it could be that this is not displayed because I am logged on (i.e. it serves no purpose to show it then?)
Thanks for your tip on the Find Tool - Advanced - use regex.
Frankly, I hardly ever use the Find Tool but use Everything or Listary instead.
Yes, I looked at Agent Ransack - it is handy indeed and gets results in PDF.
Thanks for the tip.
later: I tried the Opus advanced regex thing.
PDF: when selecting a PDF, it tries to search, but no hits, nothing
same regex on .txt files, Opus does find files containing text matching the regex, but unline Agent Ransack, it lists the filenames, but not the line# and the matched text.
Anyway, I meanwhile found a solution - which admittedly was a bit of (manual) work, but the matter is done with.
[quote="opw62"]I do see you and others have this "Contact: plus balloon" at their profile. I don't see that under my profile on the forum, but
it could be that this is not displayed because I am logged on (i.e. it serves no purpose to show it then?)[/quote]