]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/imdb.rb
imdb: fix title regexp for missing second date
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / imdb.rb
index f0497c0b503e55448f235614cc3aa9dc486db25d..a12b77843073cbed34f71f850b0dd96add8f9dfe 100644 (file)
@@ -143,7 +143,8 @@ class Imdb
       title_date = m[1].ircify_html
       debug title_date
       # note that the date dash for series is a - (ndash), not a - (minus sign)
-      pre_title, extra, date, junk = title_date.scan(/^(.*)\((.+?\s+)?(\d\d\d\d(?:–(?:\d\d\d\d)?)?(?:\/[IV]+)?)\)\s*(.+)?$/).first
+      # also, the second date, if missing, is an no-break space
+      pre_title, extra, date, junk = title_date.scan(/^(.*)\((.+?\s+)?(\d\d\d\d(?:–(?:\d\d\d\d| )?)?(?:\/[IV]+)?)\)\s*(.+)?$/).first
       extra.strip! if extra
       pre_title.strip!
       title = fix_article(pre_title)