If you want for alpha numeric then use this one "^[^-]*-?[^-]*$"
 
Reference : https://stackoverflow.com/questions/17153032/regex-to-match-a-hyphen-in-a-string-0-or-1-times