- preg_match: documentation ( source)
- print_r: documentation ( source)
<?php
$filePath = '/cv/67/6d/676d33634d07b95da37715d98575175f.docxx';
preg_match('/cv\/[0-9a-z]{2}\/[0-9a-z]{2}\/[0-9a-z]{32}\.(?:text|html|doc|docx|xls|xlsx|mht|pdf)/is', $filePath, $result);
print_r($result);