I have a file with lines like this:
CBOEA11/08/13iShares MSCI Brazil Capped ETF1EWZ Jan15201600047000 P 11/08/13
CBOEA11/08/13Cincinnati Financial Corp (EUR2CINF Jan14201400050000C 11/08/13
CBOEA11/08/13HONEYWELL INTL INC (NEW) HON Jan15201600077050C P 11/11/13
CBOEA11/08/13iShares iBoxx $ High Yield CorHYG Jan15201600084000C P 11/11/13
CBOEA11/08/13Oil States International, Inc.OIS Jan15201600100000C P 11/11/13
(note the even spacing).
I'm trying to extract several a couple of pieces of information from each line.
Stock Ticker (EWZ, CINF, HON, HYG, OIS)
Date (Jan152016, Jan142014 etc.)
I can do this in one or more steps, it doesn't matter. My regex knowledge is limited, but I started off with this:
I did r = regex.search(string), and r.groups() returns (u'Jan',)
Shouldn't this regex match the entire number after "Jan"? Of course with this date I need to match the 3 letter month and then grab the next 6 digits.
The ticker looks to be rather hard. Ideas on that too?