I have a problem breaking this line into components. An example of a line that I have is - Criminal.Minds.S10E22.WEB-DL.x264-FUM[ettv]. I try to break it down to the following:
Criminal Minds, 10, 22.
Although I scolded a bit in perl regex, the php implementation confused me.
I wrote the following:
$word = "Criminal.Minds.S10E22.WEB-DL.x264-FUM[ettv]";
$patterns = array();
$patterns[0] = '/\./';
$patterns[1] = '/-/';
$replacement = ' ';
$word = preg_replace($patterns, $replacement, $word);
print_r(preg_split('#([a-zA-Z])+\sS(\d+)E(\d+)#i', $word));
What exits Array ( [0] => Criminal [1] => WEB DL x264 FUM[ettv] )
Please point me in the right direction.
source
share