- https://www.codewars.com/kata/597770e98b4b340e5b000071 extract file name.
Started at 22:51 15.08.2020 Satruday Aug. Finished at 23:08 15.08.2020 Saturday Aug. (0hrs 17minutes)
<?php | |
# https://www.codewars.com/kata/597770e98b4b340e5b000071 extract file name. | |
function fileNameExtractor(string $dirtyFileName): string { | |
$rgx = '/^([0-9]+_)*(([a-z0-9_-]+)(\.[a-z0-9_-]+))/i'; | |
preg_match($rgx,$dirtyFileName,$matches); | |
return $matches[2]; | |
} |
Started at 22:51 15.08.2020 Satruday Aug. Finished at 23:08 15.08.2020 Saturday Aug. (0hrs 17minutes)