trying to search and replace "[" opening square bracket
<p>I'm new to python, so please forgive me if this is a stupid question:</p>

<p>I have an XML file which I'm carrying out a number of search and replaces. One of the things I need to replace is a space followed by [ with just [ (no space before). I've tried the following but keep getting an error:</p>

<pre><code>line = re.sub(' [','[',line)
</code></pre>

<p>and I assume its because the square brackets is used for wildcards, but I don't know what the syntax should be in order to get this to work</p>

<p>Any help appreciated</p>

<p>Thanks</p>
