I'm hoping someone could share some light on this for me. I'm trying to get the show name, season, episode and episode name out of a file's name. However, even though I'm pretty sure my regex has been lua-fied correctly it just returns the whole string to me.
This is what I have (title = "Continuum S01E06 Time's Up")
Code: Select all
local show_name = string.gsub(title, "(.+)%s[sS](%d{1,2})[eE](%d{1,2})%s(.*)", "%1")
local show_season = string.gsub(title, "(.+)%s[sS](%d{1,2})[eE](%d{1,2})%s(.*)", "%2")
local show_season_episode = string.gsub(title, "(.+)%s[sS](%d{1,2})[eE](%d{1,2})%s(.*)", "%3")
local show_episode_name = string.gsub(title, "(.+)%s[sS](%d{1,2})[eE](%d{1,2})%s(.*)", "%4")
vlc.msg.info("Show name: " .. show_name)
vlc.msg.info("Season: " .. string.gsub(title, "(.+)%s[sS](%d{1,2})[eE](%d{1,2})%s(.*)", "%2"))--show_season)
vlc.msg.info("Episode: " .. show_season_episode)
vlc.msg.info("Episode name: " .. show_episode_name)
Code: Select all
[0246bf10] lua generic: Show name: Continuum S01E06 Time's
[0246bf10] lua generic: Season: Continuum S01E06 Time's Up
[0246bf10] lua generic: Episode: Continuum S01E06 Time's Up
[0246bf10] lua generic: Episode name: Continuum S01E06 Time's Up