(and on top of that, we're doing a full match.)
- the pattern is found in the input
- the start of the match is the start of the input
- the end of the match is the end of the input
By this definition, 8 spaces does not match the pattern.
R*D*M* does not specify anything that has to be found in the string. Nor does any pattern of ()* or []* no matter what you put between the parens or brackets.
In all of those cases, any possible string matches the regex starting at the beginning of the string and ending at the end of the string.
Your clarification doesn't clarify anything for me.
That is literally what is happening: https://github.com/Jimbly/regex-crossword/blob/master/crossw...
Plugging the first space into a DFA described by the regex is an immediate failure - there is no exit from the initial state initiated by the space character. It's a non match.
Regex engines will say they do match because they are by default checking for for substrings that match the language (such as the initial empty string of each line of grep), not for strings that match the language.
*edit: added last paragraph.
Some regex notations include "^" and "$", and some don't. A lot of software (the grep command, for example) uses the kind that does support "^" and "$". This puzzle uses the other kind.
Essentially, when a notation includes "^" and "$", it allows writing cleaner more concise patterns. These notations add an implicit "." at the beginning and end of every pattern unless you use "^" or "$" to turn that off.
As for how you're supposed to know this, the puzzle tell you, but there is a very strong clue, which is that many of the patterns have a leading/trailing ".". This would be totally superfluous in one type of notation, so it must be the other kind.
Here are some patterns from the puzzle's notation:
.*H.*H.*
(DI|NS|TH|OM)*
F.*[AO].*[AO].*
and here are how they'd look in a notation that uses "^" and "$": H.*H
^(DI|NS|TH|OM)*$
^F.*[AO].*[AO]Edit: Fix HN oddity
% python3
>>> import re
>>> re.search(r'R*D*M*', ' ')
<re.Match object; span=(0, 0), match=''>
>>> re.fullmatch(r'R*D*M*', ' ')
>>>