title: can't concatinate variable with string?
body: <p>I'm going crazy as I learn python.</p>
  
  <p>Here is a code fragment:</p>
  
  <pre><code>import re
  
  class Spam:
      def egg(self, pat):
          print pat
  
  
  attribute_pattern = r'(\s[a-z\-]+=".*?")*'
  
  ok_uber_string = '&lt;(us-patent-grant)'  r'(\s[a-z\-]+=".*?")*'   '&gt;(.*?)(&lt;/\1&gt;)'
  bad_uber_string = '&lt;(us-patent-grant)'  attribute_pattern   '&gt;(.*?)(&lt;/\1&gt;)'
  pat = re.compile(bad_uber_string)
  </code></pre>
  
  <p>the line with bad_uber_string will not compile, get a SyntaxError: invalid syntax</p>
  
  <p>This has to be a user error, what am I doing wrong?</p>
  
  <p>Thanks
  Pat</p>