Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex seems like it should be more strict? #42

Closed
spacesuitdiver opened this issue Jul 30, 2020 · 1 comment
Closed

Regex seems like it should be more strict? #42

spacesuitdiver opened this issue Jul 30, 2020 · 1 comment

Comments

@spacesuitdiver
Copy link

spacesuitdiver commented Jul 30, 2020

I'm no regex wizard but I can't seem to figure out how to properly validate for a simple app identifier.

At a most basic level I would like for any permutation of dots and [a-zA-Z0-9] to pass but any other character used to fail.

PASS:
com
com.mycorp.we
com.mycorp.we.feature
com.mycorp.we.feature.prd

FAIL:
c-
com.my-corp
com-my-corp

I'd honestly expect [a-zA-Z0-9] as is to work but all of the failure cases with this regex pass.

@FokkeZB
Copy link
Contributor

FokkeZB commented Sep 25, 2020

The FAIL cases pass because they do contain [a-zA-Z0-9].

What you're looking for is ^[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)*$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants