title: python regex: match a string with only one instance of a character
body: <p>Suppose there are two strings:</p>
  
  <pre><code>$1 off delicious ham.
  $1 off delicious $5 ham.
  </code></pre>
  
  <p>In Python, can I have a regex that matches when there is only one $ in the string?  I.e., I want the RE to match on the first phrase, but not on the second.  I tried something like:</p>
  
  <pre><code>re.search(r"\$[0-9]+.*!(\$)","$1 off delicious $5 ham.")
  </code></pre>
  
  <p>..saying "Match where you see a $ followed by anything EXCEPT for another $."  There was no match on the $$ example, but there was also no match on the $ example.</p>
  
  <p>Thanks in advance!</p>
  
  <p>Simple test method for checking:</p>
  
  <pre><code>def test(r):
    s = ("$1 off $5 delicious ham","$1 off any delicious ham")    
    for x in s:
      print x
      print re.search(r,x,re.I)
      print ""
  </code></pre>