# 保留用户名：支持通配符？

**URL:** https://meta.discourse.org/t/reserved-usernames-wildcard/110987
**Category:** Support
**Created:** [2019年三月7日 15:26 UTC](https://meta.discourse.org/t/reserved-usernames-wildcard/110987 "2019-03-07T15:26:34Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![DrBB](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@DrBB](https://meta.discourse.org/u/DrBB)
#### Post date: [2019年三月7日 15:26 UTC](https://meta.discourse.org/t/reserved-usernames-wildcard/110987/1 "2019-03-07T15:26:34Z")

</div>

We had someone register with a reserved username, getting around the restriction by the simple expedient of adding “1” to the end. I can’t tell if the system will accept a wildcard entry to prevent this, i.e., by declaring

reservedusername\*

in the list. I’m a little hesitant to use the “just try it and see” method. Can anyone enlighten me?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2019年三月7日 15:35 UTC](https://meta.discourse.org/t/reserved-usernames-wildcard/110987/2 "2019-03-07T15:35:52Z")

</div>

> [@DrBB](#):
>
> I can’t tell if the system will accept a wildcard entry to prevent this, i.e., by declaring
> 
> reservedusername\*

It will, we mention it in the description below the setting

> Usernames for which signup is not allowed. Wildcard symbol \* can be used to match any character zero or more times.

`reservedusername*` should prevent `reservedusername1` from being registered

---

<div class="post-metadata">

### Author: ![DrBB](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@DrBB](https://meta.discourse.org/u/DrBB)
#### Post date: [2019年三月7日 16:03 UTC](https://meta.discourse.org/t/reserved-usernames-wildcard/110987/3 "2019-03-07T16:03:59Z")

</div>

> [@awesomerobot](#):
>
> It will, we mention it in the description below the setting

–Ha! I should look more closely at what’s in front of me. Thanks!

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2019年三月7日 19:13 UTC](https://meta.discourse.org/t/reserved-usernames-wildcard/110987/4 "2019-03-07T19:13:54Z")

</div>

But people will be able to register `reserved_username`.

Maybe it’s an idea to look at the Levenshtein distance instead of using a wildcard?

---

<div class="post-metadata">

### Author: ![DrBB](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@DrBB](https://meta.discourse.org/u/DrBB)
#### Post date: [2019年三月7日 21:04 UTC](https://meta.discourse.org/t/reserved-usernames-wildcard/110987/5 "2019-03-07T21:04:20Z")

</div>

> [@RGJ](#):
>
> Maybe it’s an idea to look at the Levenshtein distance instead of using a wildcard?

Yow, that would probably be a lot more bulletproof, but I’m not sure it’s worth that degree of effort. Out of curiosity, would you use a reg ex test of some kind? Can you do that in the Discourse admin?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2019年三月7日 22:37 UTC](https://meta.discourse.org/t/reserved-usernames-wildcard/110987/6 "2019-03-07T22:37:15Z")

</div>

> [@RGJ](#):
>
> Maybe it’s an idea to look at the Levenshtein distance instead of using a wildcard?

This might be more effort than it’s worth… It would catch `reserved_username1` but it probably wouldn’t catch `official_reserved_username`, right? this is the type of thing that a motivated person would always find a way around.

> [@DrBB](#):
>
> would you use a reg ex test of some kind? Can you do that in the Discourse admin?

We have a regex setting for blocked/censored words, and that seems like a reasonable way to enhance reserved usernames (which only has the wildcard)… but does this problem come up often enough to justify prioritizing that? I don’t think it’s a complaint we’ve had often.

---

<div class="post-metadata">

### Author: ![DrBB](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@DrBB](https://meta.discourse.org/u/DrBB)
#### Post date: [2019年三月7日 23:01 UTC](https://meta.discourse.org/t/reserved-usernames-wildcard/110987/7 "2019-03-07T23:01:56Z")

</div>

We only found the one instance when we searched our user names, so yeah, I don’t think it calls for anything too elaborate.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2019年三月7日 23:11 UTC](https://meta.discourse.org/t/reserved-usernames-wildcard/110987/8 "2019-03-07T23:11:39Z")

</div>

> [@awesomerobot](#):
>
> this is the type of thing that a motivated person would always find a way around.

Exactly, so why support wildcards then? 🤔

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [2019年三月8日 00:19 UTC](https://meta.discourse.org/t/reserved-usernames-wildcard/110987/9 "2019-03-08T00:19:21Z")

</div>

Isn’t that just reason to separately block `reserved` and `username`?

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2019年四月7日 00:19 UTC](https://meta.discourse.org/t/reserved-usernames-wildcard/110987/10 "2019-04-07T00:19:33Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
