title: Regex matching a string without whitespace and hash # character
body: <p>I need to validate a text box to avoid the user to enter white space or hash tag #. As of now i tried below regular expressions and achieved only to restrict space. </p>
  
  <p><strong>Case 1: Regular expression restricting Space :</strong>  <code>^\S+$</code> -  This is working </p>
  
  <p><strong>Case 2: Regular expression to restrict Space and # hash tag</strong> - <code>(\S+$)[!#]</code>  This is not working</p>
  
  <p>I need to restrict the user entering white space and hash tag #. </p>