我正在尝试从日期中找到年份。日期格式为
"Nov.-Dec. 2010"
"Aug. 30 2011-Sept. 3 2011"
"21-21 Oct. 1997"
my regular expression is
q = re.compile("\d\d\d\d")
a = q.findall(date)
所以很明显在列表中它有两个项目,如"Aug. 30 2011-Sept. 3 2011"
["2011","2011"]
我不想重复,我该怎么做?
我正在尝试从日期中找到年份。日期格式为
"Nov.-Dec. 2010"
"Aug. 30 2011-Sept. 3 2011"
"21-21 Oct. 1997"
my regular expression is
q = re.compile("\d\d\d\d")
a = q.findall(date)
所以很明显在列表中它有两个项目,如"Aug. 30 2011-Sept. 3 2011"
["2011","2011"]
我不想重复,我该怎么做?