title: Match literal string '\$'
body: <p>I'm trying to match literal string '\$'. I'm escaping both '\' and '$' by backslash. Why isn't working when I escape the backslash in the pattern? But if I use a dot then it works.</p>
  
  <pre><code>import re
  
  print re.match('\$','\$')
  print re.match('\\\$','\$')
  print re.match('.\$','\$')
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>None
  None
  &lt;_sre.SRE_Match object at 0x7fb89cef7b90&gt;
  </code></pre>
  
  <p>Can someone explain what's happening internally?</p>