fix path expansion to accept valid POSIX usernames
To be portable across systems conforming to POSIX.1-2008, the
username is composed of characters from the portable filename character
set([A-Za-z._-])[1][2].
The <hyphen-minus> character should not be used as the first
character of a portable user name.
Links:
[1] Username format:
http://pubs.opengroup.org/onlinepubs/
9699919799/basedefs/V1_chap03.html#tag_03_435
[2] Portable filename character set:
http://pubs.opengroup.org/onlinepubs/
9699919799/basedefs/V1_chap03.html#tag_03_282