Referring to Jeffrey Friedl's book on regular expressions, this was a change in Perl's regular expressions, originally. Back to 1988, according to the characters that are allowed to name the Perl variable [Page 89]:
Perl 2 1988 . , Spencer, . , | . \d \s, \w , , , Perl.