title: Extracting integers from a string and forming actual numbers from a list of these integers
body: <p>I have a string <code>bar</code>:</p>
  <pre><code>bar = 'S17H10E7S5E3H2S105H90E15'
  </code></pre>
  <p>I take this string and form groups that start with the letter <code>S</code>:</p>
  <pre><code>groups = ['S' + elem for elem in bar.split('S') if elem != '']
  groups
  ['S17H10E7', 'S5H3E2', 'S105H90E15']
  </code></pre>
  <p><strong>Without using the mini-language RegEx</strong>, I'd like to be able to get the integer values that follow the different letters <code>S</code>, <code>H</code>, and <code>E</code> in these <code>groups</code>.  To do so, I'm using:</p>
  <pre><code>code = 'S'
  temp_num = []
  
  for elem in groups:
      start = elem.find(code)
      for char in elem[start + 1: ]:
          if not char.isdigit():
              break
          else:
              temp_num.append(char)
              num_tests = ','.join(temp_num)
  </code></pre>
  <p>This gives me:</p>
  <pre><code>print(groups)
  ['S17H10E7', 'S5H3E2', 'S105H90E15']
  
  print(temp_num)
  ['1', '7', '5', '1', '0', '5']
  
  print(num_tests)
  1,7,5,1,0,5
  </code></pre>
  <p>How would I take these individual integers <code>1</code>, <code>7</code>, <code>5</code>, <code>1</code>, <code>0</code>, and <code>5</code> and put them back together to form a list of the digits following the code <code>S</code>?  For example:</p>
  <pre><code>[17, 5, 105]
  </code></pre>
  <p><strong>UPDATE</strong>:</p>
  <p>In addition to the accepted answer, here is another solution:</p>
  <pre><code>def count_numbers_after_code(string_to_read, code):
      
      index_values = [i for i, char in enumerate(string_to_read) if char == code]
      
      temp_1 = []    
      temp_2 = []
     
      for idx in index_values:
          temp_number = []
          for character in string_to_read[idx + 1: ]:
              if not character.isdigit():
                  break
              else:
                  temp_number.append(character)
  
              temp_1 = ''.join(temp_number)
          temp_2.append(int(temp_1))
      
      return sum(temp_2)
  </code></pre>