I have a regex question.
Consider user input like:
foo bar foo_bar foo-bar
I need to make sure that these possibilities exist but only
The following regex works:
But I was wondering,is there any alternative that is nicer to read?
I am especially wondering because at some later time, perhaps I
may need to enable more character tokens, such as ‘,’ so my
example may become fairly long eventually in the long run.