# Special character check in visibility conditions

**URL:** <https://community.glideapps.com/t/special-character-check-in-visibility-conditions/68954>\
**Category:** Ask for Help\
**Created:** [December 23, 2023, 7:34am UTC](https://community.glideapps.com/t/special-character-check-in-visibility-conditions/68954 "2023-12-23T07:34:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![absolutenathan](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/absolutenathan/32/61679_2.png) [@absolutenathan](https://community.glideapps.com/u/absolutenathan)\
**Post date:** [December 23, 2023, 7:34am UTC](https://community.glideapps.com/t/special-character-check-in-visibility-conditions/68954/1 "2023-12-23T07:34:53Z")

</div>

I’m making an app that uses a username system. The users can’t use any special characters with the exception of \_ or -. That includes spaces too. How would I be able to check that a user doesn’t have those on the “change username” screen to show the button to finalize their username?

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [December 23, 2023, 7:54am UTC](https://community.glideapps.com/t/special-character-check-in-visibility-conditions/68954/2 "2023-12-23T07:54:10Z")

</div>

Try this:

 ![Screenshot 2023-12-22 at 9.53.17 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/0/e0aef65542294fe84abc6274d7d3ef7826ce0dac.jpeg)

```auto
 var regex = /^[a-zA-Z0-9-_]+$/;
 return regex.test(p1);

```

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [January 5, 2024, 4:18pm UTC](https://community.glideapps.com/t/special-character-check-in-visibility-conditions/68954/3 "2024-01-05T16:18:40Z")

</div>

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