0

In a portion of a Python script, I'm trying to select all images with formats such as the examples below:

customImage0.jpg customImage1.png customImage3.gif

I currently have this code:

pattern = re.compile('customImage[0-9]*.png')

I want to modify it so I can select all image extension types, not just png. I've tried [jpg|png|gif|tiff]. That grabbed only the first letter of the file extension:

customImage0.j customImage1.p

How do I grab the whole file extension?

TigerhawkT3
  • 44,764
  • 6
  • 48
  • 82
velkoon
  • 707
  • 1
  • 8
  • 28

0 Answers0