For me, Treme was the challenge that made me explore regex in filters. But using your House example, I would do something like:
I like this a bit better because all of these patterns will match:
Code: Select all
House S07E22 720p HDTV X264
House.S07E22.720p.HDTV.X264
House S7E3 720p HDTV X264
House.S7E3.720p.HDTV.X264
House S007E022 720p HDTV X264
House.S007E022.720p.HDTV.X264
The difference is, instead of accepting any character after "house", this only accepts a space or a period (not a real big deal). But the "S[0-9]+E[0-9]+" construct accepts only an "S" followed by one or more digits followed by "E" followed by one or more digits. This way, if there is no leading 0 or more than one leading 0, or we get into 3-digit episode numbers (see The Daily Show With Jon Stewart), we still get a hit.
By the way, the regex "re:^house.S[0-9][0-9]E[0-9][0-9]*" may not be exactly what you think. The expression "E[0-9][0-9]*" is interpreted as an "E" followed by one or more digits. Within a regex expression, the star doesn't mean match the rest of the string (which I'm only guessing that you had in mind), but rather zero or more of the previous character, which in this case is the set of digits. "E[0-9][0-9]*" and ""E[0-9]+" mean pretty much the same thing.
Just saying, because regular expressions are a lot of fun to play around with.