3 ms·
The issue is two different types of regex notation. Some regex notations include "^" and "$", and some don't. A lot of software (the grep command, for example)
by adrianmonk 6y ago
The issue is two different types of regex notation.
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]
- Jimbly 6y agoTo be fair, the puzzle didn't tell them at the time of their post, I added the "must be a full match" line after seeing confusion here, and it was not in the original puzzle (people doing puzzle hunts are expected to deduce more than random people on the internet, I guess!).