If I have a filename like one of these:
184.108.40.206.1.jpg 1.1.jpg 1.jpg
How could I get only the filename, without the extension? Would a regex be appropriate?
In most cases, you shouldn't use a regex for that.
This will also handle a filename like
.bashrc correctly by keeping the whole name.
>>> import os >>> os.path.splitext("220.127.116.11.1.jpg") ('18.104.22.168.1', '.jpg')