diff --git a/mt.php b/mt.php index c60b428..23700ff 100644 --- a/mt.php +++ b/mt.php @@ -142,13 +142,13 @@ if (isset($_POST['action'])) { $matches = array(); $identifier = null; foreach ($output as $line) { - if (preg_match('/^\s(s\d\de\d\d|\d+)\s*$/i', $line, $matches)) { + if (preg_match('/^\s(s\d\de\d\d|\d+)( - ([0-9dhms ]+))?\s*$/i', $line, $matches)) { # This line is an identifier $identifier = $matches[1]; $currentEpisodes[$identifier] = array(); } else { # This line is an entry for the current identifier - if (!preg_match('/\s(.)\s+(.*)\s+(.*)\s*$/', $line, $matches)) { + if (!preg_match('/^\s+(\*?)\s+(.{1,64}?)\s+(\S+)\s*$/', $line, $matches)) { $errors[] = "Ignored unmatched line '$line'"; continue; }