# Regex Possible Username Problem

**URL:** <https://forum.freecodecamp.org/t/regex-possible-username-problem/470392>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [July 22, 2021, 9:50am UTC](https://forum.freecodecamp.org/t/regex-possible-username-problem/470392 "2021-07-22T09:50:39Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ricardomg92](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ricardomg92/32/134850_2.png) [@ricardomg92](https://forum.freecodecamp.org/u/ricardomg92)\
**Post date:** [July 22, 2021, 10:27am UTC](https://forum.freecodecamp.org/t/regex-possible-username-problem/470392/2 "2021-07-22T10:27:18Z")

</div>

Hello,

It’s because of your /g flag, if you remove it the test should pass.  
You can check the explanation of why this happens on this post:

[The “Restrict Possible Usernames” lesson is bugged - JavaScript - The freeCodeCamp Forum](https://forum.freecodecamp.org/t/the-restrict-possible-usernames-lesson-is-bugged/468841)

---

_[View the full topic](https://forum.freecodecamp.org/t/regex-possible-username-problem/470392)._
