title: Regex for valid java identifier
body: <p>I am trying to write a regex for a valid java identifier name: I have tried this:</p>
  
  <pre><code>([a-zA-Z_$][a-zA-Z\d_$]*) 
  </code></pre>
  
  <p>but it is accepting spaces also. However, I didn't allowed space to be considered as a match.</p>
  
  <p>Any idea?</p>