Skip to content.Skip to navigation
It sounds like you’re looking to create a (e.g., for a media server, torrent site, or automation script) based on the query:
Here’s how you could break it down into a reusable feature: Objective Extract structured data from a raw episode search string: "the bay s05e01 xvid" Expected Output { "title": "The Bay", "season": 5, "episode": 1, "codec": "xvid", "raw_query": "the bay s05e01 xvid" } Implementation (Python Example) import re def parse_tv_query(query: str): pattern = r'(?i)(?P<title>.+?)\s+s(?P<season>\d+)e(?P<episode>\d+)\s+(?P<codec>\w+)' match = re.search(pattern, query) the bay s05e01 xvid