Select A Word

Advanced Renamer forum
#1 : 02/09-18 21:44
David
David
Posts: 64
I need to create a method where I can specify two words.
Starting with a title like this:

[Superman] 2018-02-15 Jimmy Olsen Jimmy's Big Day.cbr

I'll start like this
\[(.*)\] (\d{4})-(\d{2})-(\d{2})

That's where I'm stalled. I don't know how to specify a word, or two words
The Jimmy Olsen placeholder is a different name all the time so I can't just use Jimmy Olsen or I'd have to have a separate rule for all the different names. I'll use this method for ebook titles too so the possibilities for that PLACEholder are limitless and unknowable. Then the name of the issue or book will just be another (.*)

Using this Replace Method
[\1] \7 (\5 \6)(\2-\3-\4)

So the results turns out like
[Superman] Jimmy's Big Day (Jimmy Olsen)(2018-02-15).cbr

The \5 \6 are the parts I don't know how to specify.

I'll also have to account for two names and a middle initial or three names and even two authors

As in
Norman Vincent Peal & Barbara DeAngeles

If you know a way I could order the different rules so they can all be active at the same time that would be great.

I don't know that that's possible because there's no way for a simple rule like that to determine if the third word is an additional name or just a word in the title

I think.

But programmers are a clever bunch and I know that someone out there probably knows how to do it it's just a question of whether they happen to be contributing to this forum.

Thanks in advance for your kind assistance.

I guess I really just need to know how to specify one word and I can make up the rest from there.


02/09-18 21:44 - edited 03/09-18 03:31
#2 : 08/09-18 11:43
Spiro Conomos
Spiro Conomos
Posts: 15
Reply to #1:
Here is a couple of suggestions you can start with but they both have caveats:

1. Regex replace:
(.*) (\d\d\d\d\-\d{1,2}\-\d{1,2} )([^ ]+ [^ ]+) (.*)
\1\4(\3)(\2)
- looks for first 2 words after the date
- caveat: limited to exactly 2 words
- on the plus side, "Jimmy" in the title isn't confused with Jimmy in the Name
- you might want to narrow down the first .* expression with the [ ] matching you used.

2. Regex replace:
(.*) (\d\d\d\d\-\d{1,2}\-\d{1,2} )(Norman.*DeAngeles) (.*)
\1\4(\3)(\2)
- adds flexibility
- needs an entry per Author.

- Note that the two methods can't coexist. So use the enable checkboxes to try them out
- I would probably use the second method and have one per author.


08/09-18 11:43