Thanks Brian and Deanhystad for the help I did not know it was that simple.
Here`s the fixed code for the people surfing on the forms ;)
Here`s the fixed code for the people surfing on the forms ;)
import re Input = 'd7 23' ###Input should output 23 via groups 2,3,6 ##Input = '23' ##Input = 'ep23' ep_regex = '((i?)EP(\d\d?))?(^\d\d?$)?(((i?)d\w[\s|:])?(\d\d?))?' ep_prog = re.compile(ep_regex) ep_result = ep_prog.match(Input) #zero = (ep_result.group(0)) one = ep_result.group(1) two = ep_result.group(2) three = ep_result.group(3) four = ep_result.group(4) five = ep_result.group(5) six = ep_result.group(6) if two or three or six: if two == None: pass else: print('Your Episode number is: %s' % (two)) if three == None: pass else: print('Your Episode number is: %s' % (three)) if six == None: pass else: print('Your Episode number is: %s' % (six)) else: print("There was no Match")