title: Python: speed for "in" vs regular expression
body: <p>When determining whether an instance of substring exists in a larger string,</p>
  
  <p>I am considering two options:</p>
  
  <p>(1) </p>
  
  <pre><code>if "aaaa" in "bbbaaaaaabbb":
      dosomething()
  </code></pre>
  
  <p>(2)</p>
  
  <pre><code>pattern = re.compile("aaaa")
  if pattern.search("bbbaaaaaabbb"):
      dosomething()
  </code></pre>
  
  <p>Which of the two are more efficient &amp; faster (considering the size of the string is huge)??</p>
  
  <p>Is there any other option that is faster??</p>
  
  <p>Thanks</p>