I have sample strings, and I have to extract the year from pandas Dataframe. I am unsure of how to do it? I tried using the pandas extract method using regular expression but I am unsuccessful.
Input:
Césio 137 - O Pesadelo de Goiânia (1990)
Nattbuss 807 (1997)
Νόμος 4000 (1962)
Output:
1990
1997
1962
I have tried using the following regex: \d\d\d\d
But in the expression, Νόμος 4000 (1962)
, I am not getting my expected result. I want to only extract 1962
, not 4000
.
I am aiming to extract the year
from the expressions given.
Thanks in advance.