Answer - 2. As per your requirement of including space, hyphen, underscore and alphanumeric characters you can use \w shorthand character set for [a-zA-Z0-9_] . Escape the hyphen using \- as it usually used for character range inside character set.
Is a hyphen alphanumeric?
Is a dash an alphanumeric character? The login name must start with an alphabetic character and can contain only alphanumeric characters and the underscore ( _ ) and dash ( – ) characters. Full name can contain only letters, digits, and space, underscore ( _ ), dash ( – ), apostrophe ( ' ), and period ( . ) characters.
How do you write alphanumeric?
If you wanted to represent the letter 'R' (upper case), you would hold the 'Alt' key and then type the number 82 from the keypad. For 'r '(lower case), you would hold the 'Alt' key and then type the number 114 on the keypad. This can be done with every alphanumeric character you want to create. Go ahead and try it!