title: searching matching string pattern from dataframe column in python pandas
body: <p>i have a data-frame like below</p>
  
  <pre><code> name         genre
   satya      |ACTION|DRAMA|IC|
   satya      |COMEDY|BIOPIC|SOCIAL|
   abc        |CLASSICAL|
   xyz        |ROMANCE|ACTION|DARMA|
   def        |DISCOVERY|SPORT|COMEDY|IC|
   ghj        |IC|
  </code></pre>
  
  <p>Now I want to query the dataframe so that i can get row 1,5 and 6.i:e i want to find |IC| with alone or with any combination of other genres.</p>
  
  <p>Upto now i am able to do either a exact search using</p>
  
  <pre><code>df[df['genre'] == '|ACTION|DRAMA|IC|']  ######exact value yields row 1
  </code></pre>
  
  <p>or a string contains search by</p>
  
  <pre><code> df[df['genre'].str.contains('IC')]  ####yields row 1,2,3,5,6
   # as BIOPIC has IC in that same for CLASSICAL also
  </code></pre>
  
  <p>But i don't want these two.</p>
  
  <pre><code>#df[df['genre'].str.contains('|IC|')]  #### row 6
  # This also not satisfying my need as i am missing rows 1 and 5
  </code></pre>
  
  <p>So my requirement is to find genres having |IC| in them.(My string search fails because python treats '|' as or operator)</p>
  
  <p>Somebody suggest some reg or any method to do that.Thanks in ADv.</p>