title: Construct file paths with different choices of extensions
body: <p>I would like to ask whether we have ways to construct file paths so that they can be true either for the first extension or the second extension when the code is executed.</p>
  <p>For example, I have a variable like this <code>photo = f&quot;{IMAGES_DIR}/{id}/{photo_folder}/{photo_folder}-original.png&quot;</code>. Now, I wanna extend its ability to receive 'jpg', like <code>photo = f&quot;{IMAGES_DIR}/{id}/{photo_folder}/{photo_folder}-original.jpg|png&quot;</code>.</p>
  <p>I think of using regular expressions, but to be honest, I don't know how to handle them in this case.</p>
  <p>I hope to receive some help from you guys. Thanks!</p>
  <p>Context provided: This is an API that I wrote. The body of the post method in Postman is {id: 'some id', photo_folder: 'some folder name}. In the past, the database just had png images, but now there are jpg images added. That's why I wanna extend that 'photo' variable so that it can deal with jpg images.</p>