Username
identity.person.usernameOnline username or handle for a user account. Typically alphanumeric with underscores, hyphens, or dots. Case-insensitive storage. Locale-specific due to character set restrictions. Following useradd(8), a name may end with a dollar sign and may be up to 256 characters long.
Shape
Length 3 to 256 characters.
^[a-zA-Z0-9_.\-]{2,255}[a-zA-Z0-9_.\-$]$| Value | Length | Shape |
|---|---|---|
| john.smith | 10 | matches |
| user_123 | 8 | matches |
| alice-wonderland | 16 | matches |
| bob.jones_42 | 12 | matches |
Told apart
Going the other way, this type's own rule accepts 2 of 5 samples of First Name, 4 of 4 samples of Gender, 2 of 5 samples of Last Name, 1 of 3 samples of Password and 1 of 5 samples of Phone Number.
The published rule follows useradd(8): 3 to 256 characters, with a dollar sign allowed only as the last character.
Background
Origin
Other terms for a username include login name, screen name, account name, nickname and handle.[1] POSIX defines a user name as a string that is used to identify a user.[2] To be portable across POSIX systems, a user name is composed of characters from the portable filename character set.[2] That set is the upper- and lower-case letters A to Z, the digits 0 to 9, and the period, underscore and hyphen-minus.[2] POSIX advises that the hyphen-minus should not be used as the first character of a portable user name.[2]
For internationalised usernames, the IETF published RFC 8265 in October 2017.[3] RFC 8265 obsoletes RFC 7613.[3] RFC 8265 defines two profiles, UsernameCaseMapped and UsernameCasePreserved.[3] The UsernameCaseMapped profile maps uppercase and titlecase code points to their lowercase equivalents.[3] RFC 8265 suggests that it is generally preferable to apply the UsernameCaseMapped profile.[3] Under RFC 8265, a username can be a space-separated sequence of userparts, though no single userpart may contain a space.[3]
Use
On Linux, the useradd manual says usernames may contain only lower and upper case letters, digits, underscores or dashes.[4] Length and character rules differ from one system to the next, so treat any fixed pattern as a description of a particular source rather than of usernames in general. (Meridian's view) Compare usernames after case-folding when the source system treats them case-insensitively, but keep the original spelling for display. (Meridian's view) A purely numeric value in a username column deserves a second look, since it may be a user ID that has been put in the wrong field. (Meridian's view)
Where you'll meet it
GitHub says usernames for user accounts on GitHub can only contain alphanumeric characters and dashes.[5] When GitHub builds a username from an external identity provider, it converts other non-alphanumeric characters to dashes, so mona.the.octocat becomes mona-the-octocat.[5]
Sources
- [1]User (computing)secondary source
- [2]Definitionsstandard
- [3]RFC 8265: Preparation, Enforcement, and Comparison of Internationalized Strings Representing Usernames and Passwordsstandard
- [4]useradd(8) - Linux manual pagedocumentation
- [5]Username considerations for external authenticationorganisation
Detection notes
v1 migration: Was person.username. Transform lowercases for canonical form. The published rule follows useradd(8): 3 to 256 characters, with a dollar sign allowed only as the last character. Column discrimination keeps the older 3 to 32 character shape (plus an optional trailing dollar sign), so UUIDs and hashes are not mistaken for usernames. Allows alphanumeric, underscore, hyphen, dot.
Use it
$ finetype infer -i "john.smith" --mode column
→ identity.person.username
SELECT ft_infer('john.smith');
-- → 'identity.person.username'LOWER(CAST({col} AS VARCHAR))Schema
https://meridian.online/schemas/identity.person.username · Frictionless type string
finetype taxonomy identity.person.username -o json-schema