Ignoring some cases

Advanced Renamer forum
#1 : 14/05-13 16:06
Lax
Lax
Posts: 6
Hello, been using this program for a while and it's amazing. Just wondering if it is possible to ignore some cases.

I wrote a regex to implement spacing to the beginning and the end of '-' character thus making it easy to read the filenames. However i wish to ignore some cases for this.

My regex:

replace: (\w*|\d*)-(\w*|\d*)
with: \1 - \2

I wish this to ignore cases of where the filename starts like this:

[Pekunya-Loho] xxx-yyy.rar

I want "[Pekunya-Loho]" stay as it is, however the above expression makes it "[Pekunya - Loho] xxx - yyy.rar" .

Is there a better way to do this? In some cases, it might not even in the beginning of the filename but or in the middle of it. It's just that i need a better control of the above expression.


14/05-13 16:06 - edited 15/05-13 02:15
#2 : 14/05-13 20:50
Stefan
Stefan
Posts: 274
Reply to #1:


To add spaces around hyphens where no spaces were before...

BEFORE:
2013-Name-Test - foo bar -Kopie.txt
Name-2013 - foo bar - Kopie.txt
Name-Test - foo-bar.txt
Name-Test - foo 05-2013.txt
Name-Test - foo - bar.txt
Name-Test - foo bar 05 - 2013.txt

AFTER:
2013 - Name - Test - foo bar -Kopie.txt
Name - 2013 - foo bar - Kopie.txt
Name - Test - foo - bar.txt
Name - Test - foo 05 - 2013.txt
Name - Test - foo - bar.txt
Name - Test - foo bar 05 - 2013.txt


better use a regex like this:

Replace Rule
FIND: '\b-\b'
REPL: '#-#'
OCCU: All
[X] Use RegEx
Apply to: Name



Notes:
- do not use the ' ' quotes in real.
- instead of the # -signs add a blank each
- the '\b' meta char is not mentioned in the AR help at
http://www.advancedrenamer.com/user_guide/regul ar_expresions
- the '\b' will match the position of a word boundary, see e.g.
http://www.regular-expressions.info/reference.h tml


.


14/05-13 20:50
#3 : 15/05-13 19:05
Lax
Lax
Posts: 6
Reply to #2:
Hmm, this doesn't help in my case considering i have many variation of files in my archive. Also, Like what happened in your example, "-Kopie" is unaffected.

BEFORE:
2013-Name-Test - foo bar -Kopie.txt
AFTER:
2013 - Name - Test - foo bar -Kopie.txt

And anyway, i have no problem inserting blanks to the beginning and the end of '-', what my problem is how to ignore some cases.


15/05-13 19:05