按格式查找事件? [关闭]

Let's say we have this string: http://192.168.1.1:8080/something/something.s01e01.2013.HDTVRip.XViD.AC3.LT.avi.mp4

I need to check if string has occurrency like this: s01e01 or s01e02, or s08e06 or etc. and then parse the numbers(s01e03 -> 1 and 3). How could I do that?

Do this:

$matches = array();
$string = 'http://192.168.1.1:8080/prOn/prOnTube.s01e01.2013.HDTVRip.XViD.AC3.LT.avi.mp4';
preg_match ( '/s([0-9]{2})e([0-9]{2})/i' , $string, $matches );

$season = intval($matches[1]);
$episode = intval($matches[2]);