I’d like to write the regular expression to recognize the series tv episode; I’m doing this in Java. Titles are written this way:
Title 2x05
Where 2 is the season and 5 is the episode; so I used this expression:
\d*x\d*
And it works perfectly fine, except when the title includes one or more “x” character; in this case I have a match exactly on this character, causing obvious problems. Is there any way to avoid this?
Are you trying to match any number of
xin between season and episode? If yes, tryuse
+instead of*to make sure there is at least one digit for season and episode and at lease onexin between.