Try just a space, not the \s
if (!eregi("([ a-zA-Z]){1,40}$", $assetname))
But just a word of warning that would allow
" Name" as being valid, you probably are waiting
"Name with spaces" as being valid?
if (!eregi("[a-zA-Z]([ a-zA-Z]){1,40}$", $assetname))