title: Python Re apply/search TypeError: 'NoneType' object is not subscriptable
body: <p>Can someone explain why I am getting this error and how to fix it? I am attempting to search a title for a year 98-99 and I want to get the first part (98):</p>
  
  <p>example title: CAR EBC 98-99</p>
  
  <pre><code>TypeError: 'NoneType' object is not subscriptable
  </code></pre>
  
  <p>on the year_min line is where the error is occuring.</p>
  
  <pre><code>import pandas as pd
  import re
  
  fileinString = 'a.csv'
  
  df1 = pd.read_csv(fileinString, sep=",")
  
  # split title of df1 into string and year tag min and year tag max
  regular_expression = re.compile(r'\d\d-\d\d')
  
  title_string = df1['*Title']
  
  
  year_min = title_string.apply(lambda x: regular_expression.search(x)[0].split('-')[0])
  
  year_max = df1['*Title'].apply(lambda x: regular_expression.search(x)[0].split('-')[1])
  
  print(year_min)
  </code></pre>
  
  <p>Close Example of it running but It doesnt work:
  <a href="https://ideone.com/JANVt2" rel="nofollow noreferrer">https://ideone.com/JANVt2</a></p>