Python regex wont match or escape backslashes : <p>So I'm trying to run through a file and match to a line in python, I understand regex but for some reason I can't get this one to work. </p>

<pre><code> p1 = re.compile("\s*(service_description)\s*([A-Z]:\\\s*Drive\s*Space)")
 for x in cfg: #cfg is an array of everyline in the file
       if p1.match(x):
            print(p1.match(x).group(2))
</code></pre>

<p>it works fine in pythex, but when I run my script I cannot get it to match. it I've tried different combos, but the second I add the \ in (trying to get a literal '\' it stops matching.</p>

<p>for reference the line I'm trying to match to is </p>

<pre><code>        service_description     M:\ Drive Space
</code></pre>

<p>where M could also be any letter caps A-Z </p>
