Special character check in visibility conditions

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?

Try this:

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

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