title: Python to search and print out the whole line just like Linux grep?
body: <p>Let's use this as example.</p>
  <pre><code>&gt;&gt;&gt; t = '''Line 1
  ... Line 2
  ... Line 3'''
  &gt;&gt;&gt; 
  </code></pre>
  <p><code>re.findall</code> only print out the specific pattern which is similar to Linux <code>grep -o</code></p>
  <pre><code>&gt;&gt;&gt; re.findall('2', t)
  ['2']
  &gt;&gt;&gt; 
  </code></pre>
  <p>Linux grep</p>
  <pre><code>wolf@linux:~$ echo 'Line 2' | grep 2
  Line 2
  wolf@linux:~$ 
  </code></pre>
  <p>Linux grep -o</p>
  <pre><code>wolf@linux:~$ echo 'Line 2' | grep 2 -o
  2
  wolf@linux:~$ 
  </code></pre>
  <p>I know it's possible to print out the whole output, I just can't think the logic at the moment.</p>
  <p>Expected Output in Python</p>
  <pre><code>Line 2
  </code></pre>
  <p>If there's better way to do this, please let me know.</p>