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
  • 48,464
  • 6
  • 60
  • 97
velkoon
  • 871
  • 3
  • 15
  • 35

0 Answers0