title: Regex pattern Alphanumeric and dollar sign
body: <p>I would like to know how I set a regex pattern for aphanumeric and dollar sign.
  Except for dollar sign, it does not accept any other special characters.</p>
  
  <p>Here are examples...</p>
  
  <p>The pattern should be okay with ....</p>
  
  <pre><code> hahah
   hohho
   hihihi
   $hahah
   hahah I will get $100 for this
  </code></pre>
  
  <p>The pattern should be sad with ....</p>
  
  <pre><code> hi James. 
   #fdasfdas
   run! 
  </code></pre>
  
  <p>Any idea? </p>
  
  <p>so you want it to require a '$' symbol somewhere in the string? – yes.</p>
  
  <p>Do you want to allow spaces also? - yes </p>
  
  <p>please add more details, unless the below answer is what you are looking for. Currently this isn't a clear question. – sorry I just got back to my machine. </p>
  
  <pre><code>    public static bool IsAlphanumericCharactersAndDollarSign(string str)
  {
      if (str == null) return false;
      Regex rg = new Regex(@"/[a-zA-z0-9\s\$]*/");
  
      return rg.IsMatch(str);
  }
  </code></pre>