So, standing back for a moment...
Initially I did not have the ^[02468] part in there.
I was thinking that by adding that, it would pick up single digit even numbers - which it does, but when the rest of the parts of the regex: were included, it then makes the regex: wrong - even for 2-digit numbers (as in numbers starting with an odd number are not picked up) - so that needs to be removed.
Wait a minute, is this now right?
- Code: Select all
file: ext:jpg regex:^\d*[02468]+[^\d]
Might be.
The only way for a number that starts with an odd digit to be even is if it is more then 1 digit (that odd digit) & ends in an even digit.
So that's good.
"1" cannot be even. But "10" is. So the regex: is good.
"2" is even & "2" is found. And so is "20", but not "21", so we're still good.
"2" is found.
Yep it is.
But then that makes me scratch my ear.
As in while it does work, makes me ponder just a bit more, "^\d*[02468]".
So... starts with 0 or more digits followed by an even number, so that also finds "2".
Which is different from starting with a digit, followed by an even number, which would not find "2" only "2[02468]", a 2-digit number.
So... even though \d* finds "2" the addition of [02468] does not necessitate that it be 2-digit. Hmm...
So ^\d* actually matches everything (the same as "regex:" [with no parameters]).
But when you then throw in [02468], you end up with even numbers... Hmm...
(All I've got time for at the moment. Neat.)