Page 1 of 1

[solved] filter regular expression does not work as intended

Posted: 05 Dec 2021, 17:37
by mister00
Hello, it’s so nice to see Cobian again alive - I must have used it under Win XP. Thanks for your work.

My problem :
* Win 10 64 bits
* I tried to filter files with a regular expression [0-9]{2,4}x[0-9]{2,4}\.jpg$
I use WordPress and WordPress generates a lot of thumbnails for a image.jpg
All the thumbnails are named like image-1200x993.jpg and I don’t want these thumbnails to be saved. But Reflector did not filter them correctly. The regular expression had been tested on another backup software and it worked.
2021-12-05_17h29_45.png
2021-12-05_17h29_45.png (56.68 KiB) Viewed 2556 times

Re: filtre regular expression does not work as intended

Posted: 06 Dec 2021, 01:07
by cobian
This is a little overcomplicating the task. I would use a mask
image-*.jpg

But yes, I will review this expression

Re: filtre regular expression does not work as intended

Posted: 06 Dec 2021, 20:38
by mister00
Sorry I may be not clear enough : I need to backup image.jpg but not image-1200x993.jpg

Re: filtre regular expression does not work as intended

Posted: 07 Dec 2021, 07:56
by gvd
Hello Mister00,

May I suggest you try with ^image-[0-9]{2,4}x[0-9]{2,4}\.jpg$ to test whether there is a problem with the interpretation of the regular expression ?

Re: filtre regular expression does not work as intended

Posted: 08 Dec 2021, 11:56
by cobian
Yes, I also think that the original expression is not to exact

Re: filtre regular expression does not work as intended

Posted: 09 Dec 2021, 01:39
by cobian
The expression image-[0-9]{2,4}x[0-9]{2,4}\.jpg$ does work. .*-[0-9]{2,4}x[0-9]{2,4}\.jpg$ does it as well.

Re: filtre regular expression does not work as intended

Posted: 09 Dec 2021, 12:04
by mister00
cobian wrote: 09 Dec 2021, 01:39 The expression image-[0-9]{2,4}x[0-9]{2,4}\.jpg$ does work. .*-[0-9]{2,4}x[0-9]{2,4}\.jpg$ does it as well.
Thanks a lot. I’m not good at all in regular expression, and it seemed to work on testing sites. It’s good now. Sorry for late answer, I don’t receive notification emails :-(