title: Python regular expression for finding string in between the text file
body: <p>I'm currently working on python code to extract a specific strings on a text file between <code>' '</code>. Here's the code I'm working on:</p>
  
  <pre><code>import re
  pattern = "(\w+'*',)"
  with open('C:\Documents and Settings\Ash\Desktop\strcount.txt', "r") as text:
      for line in text:
          print re.findall(pattern, line)
  </code></pre>
  
  <p>and the list of strings in the text file</p>
  
  <pre><code>('FLBC8U', 24)
  ('cHvQuW', 24)
  ('7FDm@', 24)
  ('15ii?', 24)
  ('H!oDe', 24)
  ('RB6#U', 24)
  ('uAmer', 24)
  ('6NmDJ', 24)
  ('d-MS1', 24)
  ('Ejf&amp;B', 24)
  </code></pre>
  
  <p>I only wanted to take the string in the middle of <code>' '</code> single quotation mark before the comma <code>,</code> so the number and the bracket is ignored</p>