Advertisement
Guest User

Regex TV shows

a guest
Jan 30th, 2015
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. ^(
  2. (?P<ShowNameA>.*[^ (_.]) # Show name
  3. [ (_.]+
  4. ( # Year with possible Season and Episode
  5. (?P<ShowYearA>\d{4})
  6. ([ (_.]+S(?P<SeasonA>\d{1,2})E(?P<EpisodeA>\d{1,2}))?
  7. | # Season and Episode only
  8. (?<!\d{4}[ (_.])
  9. S(?P<SeasonB>\d{1,2})E(?P<EpisodeB>\d{1,2})
  10. | # Alternate format for episode
  11. (?P<EpisodeC>\d{3})
  12. )
  13. |
  14. # Show name with no other information
  15. (?P<ShowNameB>.+)
  16. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement