Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
For a customer, i needed to validate the username against a german phone number, so i wrote this little module that allows to define a validation pattern for the username on registration. it's also possible to customize the error message on validation failure.
Other modules can make use of the validation as well using the function:
custom_username_validation_validate_username($username)
Notes
- If you are experiencing problems in testing the pattern, please clear your site cache.
- To result in an exact match (not partial) your regular expression should start with
^
(asserts position at start of string) and end with$
(asserts position at end of string).
Similar modules
Project information
- 205 sites report using this module
- Created by Schneck on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
7.x-1.3
released 7 October 2017
Works with Drupal: 7.x
✓ Recommended by the project’s maintainer.
Development version: 7.x-1.x-dev updated 13 Jun 2021 at 17:23 UTC