From d0f213f98948256080dbd7c2a53aa05e2bbe3c5a Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Tue, 5 Jul 2011 23:06:04 +0100 Subject: [PATCH] Updated regexes for --series foo output --- mt.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }