title: creating a regular expression in python with variables and a comma
body: <p>I am trying to match and find names exactly from one list with another list using python. </p>
  
  <pre class="lang-py prettyprint-override"><code># First List
  file = 'Last_First.csv'
  filename = file.split('_')
  last = filename[0]
  first = filename[1]
  </code></pre>
  
  <p>search a large list of names where names are saved as <code>Last, First</code> </p>
  
  <pre><code>pattern = re.compile(re.escape(last+','+first))
  # Second List
  ['63', 'Last, First', '65164345']
  </code></pre>
  
  <p>when i search the list line by line, i get an empty list</p>
  
  <pre><code>matches = pattern.findall(line)
  </code></pre>
  
  <p>printing the <code>pattern</code>, i get</p>
  
  <pre><code>re.compile(r'Last\,First', re.UNICODE)
  </code></pre>
  
  <p>how can i get rid of <code>\</code> ?</p>