Command line interface for the `re` module

Since the trend for this kind of tool seems to be towards short command names, can’t we just use

python -m re PATTERN FILE ...

as the basic incantation? It could import re.__main__ so it oughtn’t weigh down programmatic imports of the re module.

I don’t think we should put any effort into perf or functionality to match tools like ripgrep or my personal standby, good old ag (Silver Searcher). It would be nice if it could search directories though.

Maybe once we have no-GIL implemented we can add a -j flag.

10 Likes