title: Regular expression in Python won't match end of a string
body: <p>I'm just learning Python, and I can't seem to figure out regular expressions.</p>
  
  <pre><code>r1 = re.compile("$.pdf")
  if r1.match("spam.pdf"):
      print 'yes'
  else:
      print 'no'
  </code></pre>
  
  <p>I want this code to print 'yes', but it obstinately prints 'no'. I've also tried each of the following:</p>
  
  <pre><code>r1 = re.compile(r"$.pdf")
  
  r1 = re.compile("$ .pdf")
  
  r1 = re.compile('$.pdf')
  
  if re.match("$.pdf", "spam.pdf")
  
  r1 = re.compile(".pdf")
  </code></pre>
  
  <p>Plus countless other variations. I've been searching for quite a while, but can't find/understand anything that solves my problem. Can someone help out a newbie?</p>