title: (Smarty) Function preg_match or another best way
body: <p>What is the best way in smarty to create a function to parse a name?</p>
  
  <p>example:
  I have the variable {$attachment.filename}</p>
  
  <p>If the file name is .jpg|.jpeg|.gif|.png
  --- my result --- (option to open in lightbox... else no option to open in lightbox...)</p>
  
  <p>Thanks!</p>