I have potential strings like this. The fist few characters are a symbol that can be one to a few letters, but could contain weird characters like "/". Then the next six characters are always a date, YYMMDD where YY,MM,DD are always integers, but are always padded to the left with a 0 as shown. This is followed by a single character that is always 'C' or 'P', then finally a double.
AAPL220819C152.5
AAPL220819P195
AAPL220902P187.5
AAPL220819C155
AAPL220930C180
What is a regular expression that parses these strings into its constituent parts,
Symbol,
Date,
COP,
Strike
fast?
So the expected output would be:
"AAPL220819C152.5" {Symbol = "AAPL", Date = 2022-08-19, COP = "C", Strike = 152.5 }
"AAPL220819P195" {Symbol = "AAPL", Date = 2022-08-19, COP = "P", Strike = 195.0}
I have seen similar posts here but I don't understand enough to modify it.