RegExpression goes wrong! Bug!

Advanced Renamer forum
#1 : 29/08-16 11:29
Posts: 2
Example File Name List

Method [Remove pattern]
Method [Replace]

if I try to remove the very first one zero with this RegEx
^0 OR ^0{1,1}
The program will remove all zeros instead of just first one zero.

if I try to remove the very first one digit with This RegEx
^\d OR ^\d{1,1}
The program will remove all digits instead of just one digit.

Please Exam!

29/08-16 11:29 - edited 29/08-16 20:42
#2 : 29/08-16 18:41
G. Lambany
G. Lambany
Posts: 187
Reply to #1:
Simply use the replace method with the "occurence" setting set to "1st"

also, [^0] means finding one character that is NOT 0
^[0] would be the correct way to write it, to find the first 0 after the beginning of the name, but can be simplified to ^0

^\d also, to find the first digit

the reason why such simple rule remove more that it should seems to be that AR use an internal function that runs the rule multiple times, so with the occurence set to first, you should be good

I don't think it is a bug. Could maybe be implemented in a different way, but there probably is a good reason why it is like this.

hope that helps


29/08-16 18:41 - edited 20/09-16 00:41
#3 : 29/08-16 20:41
Posts: 2
I'm sorry, it's my false.

All about is "occurence" setting set to "1st".

Thank you G. Lambany.

29/08-16 20:41 - edited 30/08-16 16:46