Filter by location of number in file name

I'm looking for items in a directory that have 5 numeric numbers, 1-9.They need to be jpg files. At times it might be 7 numbers that also contain alpha characters. For this requirment it can not have alpha characters after the 5 numbers. 12345f.jpg would not be needed.

Would Work
324562.jpg
765344.jpg
213213.jpg

Some Times I would want, at different timers, 342344h.jpg. My problem is I don't know how to call for a number or alpha characters, don't know the rules. I was thinking #####.jpg would give me only 232344.jpg, numbers.

I read the filter help which has a lot of good ideas. I just could not find the right help. I was hoping to find a way to control the filter alpha & number, placement.

Bob

I was thinking this might be getting close:
^[0-9]{6}.jpg

^ Start of a String
[0-9] numbers to use
{6} total number of values in name.
.jpg Type of files

It did not give me the results I was hopping for. Being as I was looking for:
324334.jpg

Bob

I'm getting closer! This got fair results. but it gave me some unexpected results at the end.
[^{6}].jpg

It gave me hundreds of files that had 6 numbers with the JPG extension, which is good. (324234.jpg)

But I also got a few:
4266698 seal 37-016 INS 70395 639-1176.jpg
No Seal 09-018 pink 715-703-0056.jpg
No Seal addition 37-151 INS 70395 693-1176.jpg

Bob

In your first post you state you want to match 5 numeric characters, then you start trying to match 6. What are you really looking for?

Anyway

^([a-z]{2})?\d{5}\....

^ = pattern must match from the beginning of the filename
([a-z]{2})? = 2 NON digits (not necessarily alpha characters - the ? means may or may not be present
\d{5} = \d = digits - {5} means min of 5, max of 5 ({1,3} would match one to three, {5,} means five or more)

Sorry,
([a-z]{2})? = 2 alpha characters - the ? means may or may not be present

^ would be good.I really next to know how it works best. At times I even have spaces to deal with.

Bob

([a-z]{2})

Since I'm looking for 0-9 only I would think I would not use A-Z. I know {2} is most likely a value of 2, and I'm looking for 6. And since I only want jpg files this is my thought, based on what I get from example:

{{6}}.jpg

Which did not work. I must be missing something. I believe your example is based on alpha. I'm looking for numeric values. And if I'm right I don't know the symble for the numeric values I need.

Bob

Uh, I did give an explanation of the pattern, which should also have given (by reading between the lines) some pointers on modifying it. :wink:

quote

Since I'm looking for 0-9 only I would think I would not use A-Z.[/quote]But originally you stated "At times it might be 7 numbers that also contain alpha characters" (which I misread as 2 alpha followed by 5 numerics.)
The explanation above points out the "?" character at the end of the "([a-z]{2})?" and its meaning.

"[0-9]{6}" is looking for 6 numeric digits. (Or \d{6})

/s matches a space (so does "[:space:]". In a character class such as "[0-9a-z ]" a space actually matches a space

Here is a MicroSoft page on TR1 regex... msdn.microsoft.com/en-us/library/bb982727.aspx

Thanks for the help. I purchased the RegexBuddy and with a little luck I might figure out how to filter Dopus. You would think a filter would be easy. But than it is very powerful.

Bob