Now the string is looks like:
"Interest.USD,Vol=[Integrated,(0,0.101),(0.2,0.108),(1,0.110),(2,0.106),
(3,0.102),(4,0.09),(5,0.091),(6,0.09128272)],Drift=[Integrated,(0.002,0.09),
(0.24,0.0007),(0.4,0.007),(1,-0.033),(2,-0.005),(3,-0.0041),
(4,-0.3505),(5,-0.65),(7,-0.08346),(8,-0.049),(9,-0.0613),(10,-0.019)],
Risk_Neutral=YES,Lambda=0.09,FX_Volatility=0.01,FX_Correlation=0.9"
I want to grab the data following the "Vol" and "Drift" in a matrix format like:
Vol matrix:
0,0.101
0.2,0.108
1,0.110
2,0.106
3,0.102
4,0.09
5,0.091
6,0.09128272
and also the single value like 0.09 for Lambda. I guess I shuold use regular expression, but I not that familiar with that. Any suggestion? :)
P.S. I tried using:
str_extract_all(text,'[ .+? ]')
try to get the data bewteen [ and ], but it returns "."
2,0.106in your output?