New project creation fails if project name has an underscore followed by a dash or vice versa

Summary

When creating a new project, an error is received about allowed characters if the project name contains an underscore (_) followed immediately by a dash (-), or a dash (-) followed immediately by an underscore (_).

Example names I used for testing:

  • this-is-a_-test
  • this-is-a-_test

This was reported by a customer (Zendesk link, internal only), who used the following name:

  • test_-test

Steps to reproduce

Try to create a new blank project with a name that contains an underscore (_) followed immediately by a dash (-), or vice versa. Observe the error message, and project creation fails.

Example Project

N/A

What is the current bug behavior?

Screenshot:

Screenshot_2024-07-15_at_3.31.16_PM

What is the expected correct behavior?

Based on the error message provided, the project creation should be successful.

Relevant logs and/or screenshots

See above.

Output of checks

This bug happens on GitLab.com

Possible fixes