Forum Discussion
Wildcard Matching 2024
That explains your problem better.
A suggestion: Instead of relying on the user to construct a valid wild-card "like" input, why not have them submit the parameters utilizing a User Form. Then you'd get valid data input and your filtering code would probably be much simpler.
That means I would have to split the process into PQ.
I would first have to read in all the files with PQ, then call up the user form, then filter the data with VBA and LIKE, write the result into a table, read this into PQ and now I can continue with the actual data import.
IMHO this is quite a big detour and fraught with further difficulties. Thanks, but no thanks.
Let’s stick to the topic: Wildcard comparison.
During my research I often read: Use RegEx. But I have never seen how to filter real-life data with RegEx.
Don't get me wrong, you can make amazing comparisons with RegEx that you would otherwise have to write an entire parser for, very impressive.
The big problem with RegEx is the syntax, it looks like a rattlesnake has walked across the screen, no normal user understands it and even for me as an experienced programmer it is too complicated. A wildcard comparison, on the other hand, is simple and intuitive to use.
And it seems as it is too difficult to do a wildcard comparison with file paths using RegEx for you too. (Don’t get me wrong, I didn’t manage it either). Or is there an update that I missed?
Andreas.
- ronrsnfld2 years agoSuper User
a. I stopped working on the regex when you reported you had your routine working, and also that the regex was considerably slower. But if your routine is not returning what you need, I'll be happy to finish up the regex now that I have more information.
b. I didn't realize you would have to read in all the files if you chose to use a user form. My idea of that was just to replace whatever you are using now to obtain the wild card string from the user, with a form that had a more structured input.