You know... if you want it to match anywhere in the line of text, or with/without various words (e.g. "the"), then you're really getting complicated.
Trying to make a script that will handle all combinations of filenames that people send of the various show episodes is an effort in futility because no matter how many exceptions you throw into the script, it's not an intelligent script. It will never be able to notice everything that you notice. Ok, so you decide to ignore "The" in the filename. What about when someone doesn't have "A" in the title? Ok, so you add that in there. What if people format it with - instead of .? Ok, you add that in. What if people put something else in front of the name?
Do you see where I am going with this? I suppose you could eventually find 99% of the possible ways the filenames will be formatted, but it will take quite awhile to find them all. Also, by the time you get them all working, it will probably have to search through the file/hash table/whatever so many times that it will be a waste of CPU to do so.
People ask for MP3 sorters all the time (same basic idea you want). It just isn't possible to make something that will catch all possibilities when you are getting filenames from different people because they will all format them differently.
Perhaps the best suggestion I'd give you would be to try and set up a multi-level system to check each "word" to.
file.txt
--
The
-The.Daily.Show
-The.Daily
-The.Colbert.Report
-The.Colbert
Colbert
-Colbert.Report
Daily
-Daily.Show
--
With this sort of structure, you could do a search for Daily. It would tell you that Daily.Show was a match, so you could see if .Show follows Daily. If so, it's a match. If not, it's not and you go on to the next.
If it started with The, then it would first check The.Daily.Show, if that's not a match, it would check The.Daily, if that's not a match, then it would continue down. If nothing matches, it would move on to the second part of the text (second token in $1).
This really is a very intensive process, but it may be the closest you'll get to 100% accuracy as it wouldn't hang up on missing words or extra words, as long as no words are inserted in the middle of the title.