title: Using regex with special characters to find a match in python
body: <p>I am extracting a string and need to check whether it follows a particular pattern </p>
  
  <blockquote>
    <p><code>&lt;![any word]&gt;</code></p>
  </blockquote>
  
  <p>if so I need to replace it with "". I am trying the following code</p>
  
  <pre><code>string1 = "&lt;![if support]&gt; hello"
  string = re.sub(re.compile("&lt;![.*?]&gt;"),"",string1)
  print(string)
  </code></pre>
  
  <p>But I am getting the output as</p>
  
  <pre><code>&lt;![if support]&gt; hello 
  </code></pre>
  
  <p>I wish to get the output as hello. What am I doing wrong here?</p>