title: Unable to remove whitespaces from list items
body: <p>Would request you to help me out on this , I am unable to remove white spaces from list elements which show unnecessary whitespaces . Can you please help me remove it .</p>
  <p>I need to fetch lines having ip 1.1.1.1/32 and 3.3.3.3/32 in the beginning and fetch all the items in a list.</p>
  <p>I tried the same through regex, the white spaces are removed but i am unable to fetch the last digit item from table .</p>
  <p>Please provide the solution for the same :</p>
  <pre><code>import re
  from io import StringIO
  
  output = &quot;&quot;&quot;
  ---------------------------------------------------------------------------
                    |           Up              |         Down              |
    Net     Prefix  |---------------------------+---------------------------
                    |       ASR        |  L     |       A          | Label  |
  ------------------+------------------+--------+------------------+---------
          1.1.1.1/32|  162.148.102.2:0 |     102|         -        |    -   |
       10.10.40.0/24|  162.148.102.2:0 |     101|         -        |    -   |
          1.1.1.1/32|  162.148.102.2:0 |     100|         -        |    -   |
          3.3.3.3/32|         -        |    -   |  162.148.102.2:0 |     103|
    192.158.104.0/24|         -        |    -   |  162.148.102.2:0 |     105|
          2.2.2.2/32|         -        |    -   |  162.148.102.2:0 |     106|
       10.30.50.0/24|         -        |    -   |  162.148.102.2:0 |     107|
  
  ---------------------------------------------------------------------------
  &quot;&quot;&quot;
  
  
  
  a = &quot;1.1.1.1/32&quot;
  b = &quot;3.3.3.3/32&quot;
  output  = StringIO (output)
  
  i = 0
  j = 0
  for line in output.read().split('\n'):
      if b in line:
          tempa_i = line.strip().split('|')
          res_i = [ele for ele in tempa_i if ele.strip(' ')]
          i = i+1
      if a in line:
          tempb_j = re.findall(r'(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})',line)
          j = j+1
  
  print (i)
  print (j)
  
  for list_ in range (i):
      print((res_i))
  for list_ in range (j):
      print(tempb_j)
  </code></pre>
  <p>Observed Output :</p>
  <pre><code>['3.3.3.3/32', '         -        ', '    -   ', '  162.148.102.2:0 ', '     103']
  ['1.1.1.1', '162.148.102.2']
  ['1.1.1.1', '162.148.102.2']
  </code></pre>
  <p>Expected output:</p>
  <pre><code>['3.3.3.3/32', '-', '-', '162.148.102.2:0', '103']
  ['1.1.1.1/32', '162.148.102.2:0', '102', '-', '-']
  ['1.1.1.1/32', '162.148.102.2:0', '100', '-', '-']
  </code></pre>