I want to pull some values out of string (in function)
if(!preg_match('/(.+)\.([0-9]*)x([0-9]*)(w|wr|r)?\.([^\.]+)$/', $filename, $matches))
return false;
$file = $matches[1];
$width = $matches[2];
$height = $matches[3];
$set_watermark_or_nonconstrain = $matches[4]; // that's what I need to fix
$ext = $matches[5];
However, if I set string like {$image[0]->filename|resize:614:300:r} (Smarty), all goes well except that $set_watermark_or_nonconstrain is always 'w'. What do I need to set instead of w|wr|r to pull 'w', 'wr' or 'r' from this submask? Thanks!