A rule needs edges
A check that passes inside a longer string is not a rule about the string. Pin both ends when the whole value matters.
Trailing spaces
An anchored pattern fails on trailing whitespace. Trim the input or allow the space in the pattern.