I have this string: "232_0452 Render 2.mov" And this regex: .*(\s?[Rr]ender).* If I execute: match = re.match(r'.*(\s?[Rr]ender).*', "232_0452 Render 2.mov") print(match.group(1)) I expect the output to be " Render". Instead it is "Render" Why does the optional white space character not get captured to the group, and how can I write this so that it does? Continue reading...