4 ms·
R*D*M* should match empty string or a string of 8 spaces. or any combination of characters. It should be impossible not to match. Edit: Fix HN oddity
by freeopinion 6y ago
R*D*M* should match empty string or a string of 8 spaces. or any combination of characters. It should be impossible not to match.
Edit: Fix HN oddity
- deleted 6y ago[deleted]
- danaliv 6y agoA full match has to exhaust all of the characters in the string. R*D*M* is indeed a match for a string of eight spaces, but it isn't a full match, because there are still eight spaces left over after matching. % python3 >>> import re >>> re.search(r'R*D*M*', ' ') <re.Match object; span=(0, 0), match=''> >>> re.fullmatch(r'R*D*M*', ' ') >>>