News for hackers. Stuff that matters.
Re:RegEx Crossword by freeopinion on Friday March 12, 2021 @05:00PM (#26441507)
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

Re:RegEx Crossword by danaliv on Friday March 12, 2021 @05:59PM (#26442004)
A 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*', '        ')
    >>>