# Username requirements

**URL:** https://discuss.openedx.org/t/username-requirements/6714
**Category:** Site Operators
**Tags:** devstack
**Created:** [February 25, 2022, 12:24pm UTC](https://discuss.openedx.org/t/username-requirements/6714 "2022-02-25T12:24:07Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![joel.edwards](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/joel.edwards/32/3193_2.png) [@joel.edwards](https://discuss.openedx.org/u/joel.edwards)
#### Post date: [February 25, 2022, 12:24pm UTC](https://discuss.openedx.org/t/username-requirements/6714/1 "2022-02-25T12:24:08Z")

</div>

Hi all

I see when registering accounts on my Open edX instance there is the following requirement for self-registration:

```auto
Usernames can only contain letters (A-Z, a-z), numerals (0-9), underscores (_), and hyphens (-).

```

This requirement basically eliminates name.surname options for self registration, but as a Django admin I can create users with a DOT in the username. How can I expand self-reg to support dots in the username?

Majority of the other services that I run use name(dot)surname so I’d like to keep this consistent for my staff wherever possible.

Thank you 🙂

---

<div class="post-metadata">

### Author: ![mgmdi](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/mgmdi/32/1684_2.png) [@mgmdi](https://discuss.openedx.org/u/mgmdi)
#### Post date: [February 25, 2022, 3:17pm UTC](https://discuss.openedx.org/t/username-requirements/6714/2 "2022-02-25T15:17:41Z")

</div>

Hello there Joel! I hope you’re doing great 😜

You can try adding to your lms.yml a regex expression that includes dots, I tested this:

```auto
FEATURES:
    ENABLE_UNICODE_USERNAME: true
...

USERNAME_REGEX_PARTIAL: '[\w._+-]+'

```

You can change the regex exp according to your needs. And the result was

 ![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/2/2f60bc7512744a55607aad86932d27773996236a.png)

---

<div class="post-metadata">

### Author: ![Tim\_McCormack](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/tim_mccormack/32/9733_2.png) [@Tim\_McCormack](https://discuss.openedx.org/u/Tim_McCormack)
#### Post date: [February 25, 2022, 6:54pm UTC](https://discuss.openedx.org/t/username-requirements/6714/3 "2022-02-25T18:54:05Z")

</div>

Ah nice, that setting automatically gets wrapped in `^___$`: [edx-platform/registration\_form.py at db32ff2cdf678fa8edd12c9da76a76eef0478614 · openedx/edx-platform · GitHub](https://github.com/openedx/edx-platform/blob/db32ff2cdf678fa8edd12c9da76a76eef0478614/openedx/core/djangoapps/user_authn/views/registration_form.py#L70)

---

<div class="post-metadata">

### Author: ![joel.edwards](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/joel.edwards/32/3193_2.png) [@joel.edwards](https://discuss.openedx.org/u/joel.edwards)
#### Post date: [February 28, 2022, 7:04am UTC](https://discuss.openedx.org/t/username-requirements/6714/4 "2022-02-28T07:04:53Z")

</div>

Awesome, thanks @mgmdi🙂

Interestingly when I put both  
ENABLE\_UNICODE\_USERNAME: true  
USERNAME\_REGEX\_PARTIAL: ‘[\w.\_±]+’  
into the configs then I get Internal Server Error on my browser.

I then removed USERNAME\_REGEX\_PARTIAL and somehow that seemed to work just fine on it’s own and now I can register email addresses with dots 😃  
Thank you very much

---

<div class="post-metadata">

### Author: ![Tim\_McCormack](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/tim_mccormack/32/9733_2.png) [@Tim\_McCormack](https://discuss.openedx.org/u/Tim_McCormack)
#### Post date: [February 28, 2022, 3:27pm UTC](https://discuss.openedx.org/t/username-requirements/6714/5 "2022-02-28T15:27:36Z")

</div>

Looks like as of latest on master, the regex includes a period by default: [edx-platform/common.py at 0157518a9cf0d8d92e3640d4d3160682b7bdd1b6 · openedx/edx-platform · GitHub](https://github.com/openedx/edx-platform/blob/0157518a9cf0d8d92e3640d4d3160682b7bdd1b6/lms/envs/common.py#L1374) (and also space and `@`).

---

<div class="post-metadata">

### Author: ![allen\_luna](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/allen_luna/32/6435_2.png) [@allen\_luna](https://discuss.openedx.org/u/allen_luna)
#### Post date: [July 17, 2024, 3:42am UTC](https://discuss.openedx.org/t/username-requirements/6714/6 "2024-07-17T03:42:14Z")

</div>

Hi @mgmdi

I do add ENABLE\_UNICODE\_USERNAME: true inside the lms.yml followed by tutor config save and automatically placed it inside config.yml after tutor config save and tutor images build openedz but the result is still the same I can’t register username with dots

---

<div class="post-metadata">

### Author: ![Juan-Carlos](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/juan-carlos/32/7075_2.png) [@Juan-Carlos](https://discuss.openedx.org/u/Juan-Carlos)
#### Post date: [July 17, 2024, 2:10pm UTC](https://discuss.openedx.org/t/username-requirements/6714/7 "2024-07-17T14:10:59Z")

</div>

Hello allen\_luna,  
What version are you using? Because from Quince to validate the user name field you can modify the regular expression from the constant:

INVALID\_NAME\_REGEX: /[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b([-a -zA-Z0-9()@:%_+.~#?&//=]\*)?/gi;

In the File  
src/register/RegistrationFields/NameField/validator.js

---

<div class="post-metadata">

### Author: ![allen\_luna](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/allen_luna/32/6435_2.png) [@allen\_luna](https://discuss.openedx.org/u/allen_luna)
#### Post date: [July 17, 2024, 7:14pm UTC](https://discuss.openedx.org/t/username-requirements/6714/8 "2024-07-17T19:14:56Z")

</div>

Yes the version I used is Quince, Thank you @Juan-Carlos you owe me a beer. hahaha
