I have dataframe df with a column (textline) that consists of text
df['textline'].iloc[0] = 'This is a test with 2018\n'
df['textline'].iloc[1] = 'This is a test with Jan 2018\n'
df['textline'].iloc[2] = 'This is a test with Feb 2018\n'
I want to use Regex extractall to run through the entire df['textline'] but it will only extract the year when there is no preceeding Month names. For example, in the above example, it will extract 2018 from the first line, but not the 2018 from the second or third line because it has the Jan or Feb (or other months).
df['textline'].str.extractall(r'<<Regex code>>')