Title: username invalid
Last modified: August 18, 2016

---

# username invalid

 *  [chabo](https://wordpress.org/support/users/chabo/)
 * (@chabo)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/username-invalid/)
 * Hi, I running WP 2.0.2
 * I want to use username includes ‘-‘, but this username is invalid.
 * sanitize_user in wp-include/functions-formatting.php return invalid.
 * >  // If strict, reduce to ASCII for max portability.
   >  if ( $strict ) $username
   > = preg_replace(‘|[^a-z0-9 _.-@]|i’, ”, $username);
 * ‘.-@’ in pattern means form ‘.’ to ‘@’, not includes ‘-‘.
 * And WP 2.0 code is
 * >  function sanitize_user( $username ) {
   >  return preg_replace(‘|a-z0-9 _.-|i’,”,
   > $username); }
 * WP 2.0.2 code like WP 2.0 code add ‘@’.
    ‘-‘ doesn’t mean character range, means‘\-‘?
 * Bad English, Sorry.

The topic ‘username invalid’ is closed to new replies.

## Tags

 * [invalid](https://wordpress.org/support/topic-tag/invalid/)
 * [sanitize](https://wordpress.org/support/topic-tag/sanitize/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [chabo](https://wordpress.org/support/users/chabo/)
 * Last activity: [20 years, 2 months ago](https://wordpress.org/support/topic/username-invalid/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
