% python3 >>> import re >>> re.search(r'R*D*M*', ' ') <re.Match object; span=(0, 0), match=''> >>> re.fullmatch(r'R*D*M*', ' ') >>>