I do not have much experience with JavaScript regex and am unsure how to only allow an input to have alphanumeric characters with a single space between groups of these characters.
Some examples of what is desirable:
"abcde"
"ab cde"
"ab c de"
Some examples of what is undesirable:
" abcde"
"abcde "
"ab c de"
I realize that I could use trim() to handle the first and last cases, split(" "), and then only concatenate non-empty strings but want to know how to do this with regex.
On a side note, I am fine with using \w to represent allowable characters, "_" is not a problem.