title: python regular expression to search regular pattern in file
body: <p>I want a function to find a pattern(word character) on each line inside a file. my code is sort of working but it does not go further after reading the first line. can anyone help? import re</p>
  
  <pre><code>    inputtext = open('input.txt', 'r+')
      inputtext1 = inputtext.read()
  
  
      match = re.search(r'([matchwordinline].*\n)+', inputtext1)
  
  
  
      if match:
  
              match1 = match.group()
      print match1
  </code></pre>