Try
->assert('hash', '[a-zA-Z0-9.]+')
Why not [\w.]?
You marked your question as PHP, so I assume this guide applies. And there he reads
\w
any "word" character
and
"" , , "Perl". PCRE , . , "fr" () , , 128, \w.
\w äöüß... .
,
->assert('hash', '[a-fA-F0-9.]+')
., G Z ...