Python - remove parts of a string <p>I have many fill-in-the-blank sentences in strings, </p> <p>e.g. <code>"6d) We took no [pains] to hide it ."</code></p> <p>How can I efficiently parse this string (in Python) to be </p> <pre><code>"We took no to hide it"? </code></pre> <p>I also would like to be able to store the word in brackets (e.g. "pains") in a list for use later. I think the regex module could be better than Python string operations like split().</p>