"Searching for- 720p WEBRip x264 GalaxyTV in-All..."

It sounds like you want to create a that can handle a specific query pattern:

import re pattern = r'(?P<resolution>\d+p)?\s*(?P<source>WEBRip|BluRay|DVD)?\s*(?P<codec>x264|x265|H264)?\s*(?P<group>[A-Za-z0-9]+)?' query = "720p WEBRip x264 GalaxyTV"