regex for alphanumeric with space and hyphen code example Example: regular expression alphanumeric with spaces java script /^[a-z\d\-_\s]+$/i