I need to make a regular expression that matches something like:
JG2144-141/hello
or
!
but not:
laptop bag
or a string consisting of whitespace chars only (' ').
Right now I have [A-Za-z0-9-!/\S], but it isn't working because it still matches with laptop and bag individually. It shouldn't match laptop bag and the empty string at all.