I have the following string from which I want to extract the content between the second pair of colons (in bold in the example):
"20160607181026_0000005:0607181026000000501:ES5206956802492:479"
I am using R and specifically the stringr package to manipulate strings. The command I attempted to use is:
str_extract("20160607181026_0000005:0607181026000000501:ES5206956802492:479", ":(.*):")
where the regex pattern is expressed at the end of the command. This produces the following result:
":0607181026000000501:ES5206956802492:"
I know that there is a way of grouping results and back-reference them, which would allow me to select only the part I am interested in, but I don't seem to be able to figure out the right syntax.
How can I achieve this?