title: Python Search File For Specific Word And Find Exact Match And Print Line
body: <p>I wrote a script to print the lines containing a specific word from a bible txt file.The problem is i couldn't get the exact word with the line instead it prints all variations of the word.</p>
  
  <p>For eg. if i search for "am" it prints sentences with words containing      "lame","name" etc.
  Instead i want it to print only the sentences with "am" only</p>
  
  <p>i.e, "I am your saviour", "Here I am" etc</p>
  
  <p>Here is the code i use: </p>
  
  <pre><code>import re
  text = raw_input("enter text to be searched:")
  
  shakes = open("bible.txt", "r")
  
  for line in shakes:
      if re.match('(.+)'  +text+  '(.+)', line):
          print line 
  </code></pre>