title: Regular Expressions - testing if a String contains another String
body: <p>Suppose you have some this String (one line)</p>
  
  <blockquote>
    <p>10.254.254.28 - - [06/Aug/2007:00:12:20 -0700] "GET
    /keyser/22300/ HTTP/1.0" 302 528 "-"
    "Mozilla/5.0 (X11; U; Linux i686
    (x86_64); en-US; rv:1.8.1.4)
    Gecko/20070515 Firefox/2.0.0.4"</p>
  </blockquote>
  
  <p>and you want to extract the part between the GET and HTTP (i.e., some url) but only if it contains the word 'puzzle'. How would you do that using regular expressions in Python?</p>
  
  <p>Here's my solution so far.</p>
  
  <p><code>match = re.search(r'GET (.*puzzle.*) HTTP', my_string)</code></p>
  
  <p>It works but I have something in mind that I have to change the first/second/both <code>.*</code> to <code>.*?</code> in order for them to be non-greedy. Does it actually matter in this case?</p>