diff --git a/src/Validator.php b/src/Validator.php index 8d202867..32dc006b 100644 --- a/src/Validator.php +++ b/src/Validator.php @@ -43,7 +43,7 @@ class Validator $this->validateNonEmpty($userName, 'User name'); $this->validateLength($userName, $minUserNameLength, $maxUserNameLength, 'User name'); - if (preg_match('/[^a-zA-Z_-]/', $userName)) + if (preg_match('/[^a-zA-Z0-9_-]/', $userName)) { throw new \DomainException('User name may contain only characters, numbers, underscore (_) and dash (-).'); }