I have a python script that reads from a config file. The config file is going to contain some user defined regex patterns. However, I was thinking I’d like to let the user use either full regex patterns, OR shell wildcards. So I should be able to interpret both
*.txt
as well as
.*\.txt$
correctly. So those 2 should be equivalent.
However I’d like to be able to do this without making the user tell me which they’re using. Is this even possible? Maybe allowing full regex is overkill.
You can’t do this. What should
prefix.*match? What aboutsomefiles?? These have very different meanings in regex vs glob matching, but are common use cases in both.