Hacker News new | past | comments | ask | show | jobs | submit login

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*', '        ')
    >>>



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: