Reputation: 11
I'm having trouble with my regex for finding all directories with a number and letter in the title.
Basically in //"E:\SomeProvider\SomeGame\build\images\1136x640\img.png"
I am looking for an output of //"1136x640"
Upvotes: 1
Views: 82
Reputation: 1699
Without a better set of examples or explanation, this is the best regex I can think of:
[^\\/]*(?:[a-zA-Z][^\\/]*\d|\d[^\\/]*[a-zA-Z])[^\\/]*
Basically it matches everything that is not \
or /
that contains a letter and a number after, or vice versa.
You can see a more detailed explanation here and test your own examples.
Upvotes: 1