My conditions ...
- Alpha-Numeric value
- Only one space or hyphen is allowed
- Must contain at least one number
- Cannot start or end with space or hyphen
- Minimum 2 characters, maximum 16 characters excluding space/hyphen
As of now I prepared the regex
^(?=.{2,16}$)([a-zA-Z\d]+)([\s^\-]|[\-^\s]|[a-zA-Z\d]*)([a-z[A-Z\d]+)
Its only missing 3rd point.
Test strings Valid
"test one"
"test 2two"
"test3 three222"
"3test-4four"
Invalid
"-test"
"test-d f"