title: Use regex to remove/exclude columns from dataframe - Python
body: <p>I have a dataframe which can be generated from the code below</p>
  
  <pre><code>    df = pd.DataFrame({'person_id' :[1,2,3],'date1': ['12/31/2007','11/25/2009','10/06/2005'],'date1derived':[0,0,0],'val1':[2,4,6],'date2': ['12/31/2017','11/25/2019','10/06/2015'],'date2derived':[0,0,0],'val2':[1,3,5],'date3':['12/31/2027','11/25/2029','10/06/2025'],'date3derived':[0,0,0],'val3':[7,9,11]})
  </code></pre>
  
  <p>The dataframe looks like as shown below</p>
  
  <p><a href="https://i.stack.imgur.com/HgNRA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HgNRA.png" alt="enter image description here"></a></p>
  
  <p>I would like to remove columns that contain "derived" in their name. I tried different regex but couldn't get the expected output.</p>
  
  <pre><code>    df = df.filter(regex='[^H\dDerived]+', axis=1)
      df = df.filter(regex='[^Derived]',axis=1)
  </code></pre>
  
  <p>Can you let me know the right regex to do this?</p>